Maps/Operations and Performance: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
According to OpenJDK source code, TreeMap should take O(log N) time. So, the TreeMap only LOOKS like it is O(1). Have to get to really large TreeMaps to get actual O(N) performance, I guess. | According to OpenJDK source code, TreeMap should take O(log N) time. So, the TreeMap only LOOKS like it is O(1). Have to get to really large TreeMaps to get actual O(N) performance, I guess. | ||
https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/java/util/TreeMap.java | |||
=Flags= | =Flags= | ||
Revision as of 00:34, 28 June 2017
Notes
Link on git.charlesreid1.com: https://charlesreid1.com:3000/cs/java/src/master/hash/timing/TimingMap.java
According to OpenJDK source code, TreeMap should take O(log N) time. So, the TreeMap only LOOKS like it is O(1). Have to get to really large TreeMaps to get actual O(N) performance, I guess.
https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/java/util/TreeMap.java
Flags
| Maps and Dictionaries Part of Computer Science Notes
Series on Data Structures
Maps/Dictionaries Maps · Maps/ADT · Maps in Java · Maps/OOP · Maps/Operations and Performance Map implementations: Maps/AbstractMap · Maps/UnsortedArrayMap · Maps/SortedArrayMap Dictionary implementations: Dictionaries/LinkedDict · Dictionaries/ArrayDict
Hashes Hash Maps/OOP · Hash Maps/Operations and Performance Hash Maps/Dynamic Resizing · Hash Maps/Collision Handling with Chaining Hash functions: Hash Functions · Hash Functions/Cyclic Permutation Hash map implementations: Hash Maps/AbstractHashMap · Hash Maps/ChainedHashMap
Skip Lists · Java/ConcurrentSkipList · Java implementations: SkipList
Sets Sets · Sets/ADT · Sets in Java · Sets/OOP · Multisets
|