Map / Dictionary (Associative Array ADT)

Interactive Visualization — Put / Get / Remove with Ordering Variants

avg O(1) O(log n) tree key -> value 3 ordering variants

Map Variant

Unordered (HashMap)
Sorted (TreeMap)
Insertion-Ordered
Unordered map: hash-backed, average O(1) get/put/remove; iteration order is arbitrary.

Operations

Entries (0)

Iteration Order (arbitrary)

empty

Last Operation

Choose a variant and run put, get, or remove.

Stats

0
size
0
puts
0
gets
0
hits
0
misses
0
removes

Big-O per variant

OpHashTreeLinked
getO(1)*O(log n)O(1)*
putO(1)*O(log n)O(1)*
removeO(1)*O(log n)O(1)*
iterateO(n)O(n)O(n)
firstKeyO(log n)O(1)
floorKeyO(log n)

* O(1) average; O(n) worst case under adversarial hashing.

Variant Summary

Hash: fastest, undefined order.
Tree: O(log n), keys sorted, range queries.
Linked: hash + insertion order, basis of LRU.

Operation Log