June 2018
Intermediate to advanced
316 pages
6h 34m
English
The following table shows the time complexity of the most common map operations:
| Get | ContainsKey | Next | Data structure | |
| HashMap | O(1) | O(1) | O(h / n) | Hash table |
| LinkedHashMap | O(1) | O(1) | O(1) | Hash table + linked list |
| IdentityHashMap | O(1) | O(1) | O(h / n) | Array |
| WeakHashMap | O(1) | O(1) | O(h / n) | Hash table |
| EnumMap | O(1) | O(1) | O(1) | Array |
| TreeMap | O(log n) | O(log n) | O(log n) | Red-black tree |
| ConcurrentHashMap | O(1) | O(1) | O(h / n) | Hash tables |
| ConcurrentSkipListMap | O(log n) | O(log n) | O(1) | Skip list |
Read now
Unlock full access