June 2018
Intermediate to advanced
316 pages
6h 34m
English
The following table shows the time complexity of the most common set operations:
| Add | Contains | Next | Data structure | |
| HashSet | O(1) | O(1) | O(h/n) | Hash table |
| LinkedHashSet | O(1) | O(1) | O(1) | Hash table + linked list |
| EnumSet | O(1) | O(1) | O(1) | Bit vector |
| TreeSet | O(log n) | O(log n) | O(log n) | Red-black tree |
| CopyOnWriteArraySet | O(n) | O(n) | O(1) | Array |
| ConcurrentSkipListSet | O(log n) | O(log n) | O(1) | Skip list |
Read now
Unlock full access