UnorderedMap Visualizer
Hash table using separate chaining for collision resolution
UnorderedMap Operations:
Basic Operations:
- insert/put(key, value): Add or update key-value pair
- find/get(key): Retrieve value for given key
- erase/remove(key): Delete key-value pair
- count/contains(key): Check if key exists
Collision Handling:
- Separate Chaining: Each bucket is a linked list
- Chain Traversal: Linear search within each chain
Characteristics:
- Average Time: O(1) for all operations
- Worst Case: O(n) if all keys hash to same bucket
- Space: O(n) for entries + O(b) for buckets
- No Ordering: Keys are not stored in any particular order
- Dynamic Resizing: Can resize to maintain performance
- Use Cases: Caches, frequency counting, graph adjacency lists
Separate Chaining vs Linear Probing: Separate chaining handles collisions by storing multiple entries in each bucket using linked lists, while linear probing finds the next empty slot. Chaining never runs out of space but uses extra memory for pointers.