Collections#
Stack#
Map#
Type |
Method |
Description |
---|---|---|
|
|
Associates the specified value with the specified key in this map (optional operation). |
|
|
If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value. |
|
|
Copies all of the mappings from the specified map to this map (optional operation). |
|
|
Returns |
|
|
Returns |
|
|
Returns the value to which the specified key is mapped, or |
|
|
Returns the value to which the specified key is mapped, or |
|
|
Returns a Set view of the mappings contained in this map. |
merge(K key, V value, BiFunction<? super V, ? super V, extends V> remappingFunction)
V computeIfAbsent(K key, Function<K, V> mappingFunction)
Operation |
HashMap |
TreeMap |
LinkedHashMap |
---|---|---|---|
Insertion |
\(O(1)/O(\log{n})\) |
\(O(\log{n})\) |
\(O(1)/O(n)\) |
Deletion |
\(O(1)/O(\log{n})\) |
\(O(\log{n})\) |
\(O(1)/O(n)\) |
Search |
\(O(1)/O(\log{n})\) |
\(O(\log{n})\) |
\(O(1)/O(n)\) |
Queue#
PriorityQueue#
PriorityQueue()
PriorityQueue(int initialCapacity)
PriorityQueue(Comparator comparator)