Algorithms / 5 visualizations
Hashing Visualizers
How hash tables really work, the O(n) Two Sum, a hash-map sliding window and anagram counting.
Open the lab → Every one runs on your own input, step by step, with the code highlighted in Java, Python, C++, C or JavaScript. Free, no sign-up.
All hashing visualizations
- Hash Table with ChainingO(n)
hash(key) mod m picks a bucket. Keys that land in the same bucket (a collision) are kept in a short list. Lookup only scans one bucket.
- Two Sum with a Hash MapO(n)
Walk once. For each value, ask the hash map whether its partner (target − value) was already seen. If not, remember this value and its index.
- Longest Substring Without RepeatsO(n)
Grow the window to the right one letter at a time. A hash map remembers where each letter was last seen; on a repeat inside the window, jump the left edge just past that earlier copy.
- Valid AnagramO(n)
Count every letter of the first word up, and every letter of the second word down. They are anagrams only if every count ends at 0.
- Group AnagramsO(n·k log k)
Sort the letters of each word. Anagrams give the same sorted key, so a hash map from key to list collects each group in one pass.
Other topics
- Sorting Algorithm visualizers
- Searching Algorithm visualizers
- Linked List, Stack and Queue visualizers
- Tree Algorithm visualizers
- Graph Algorithm visualizers
- Coding Interview Pattern visualizers
- Dynamic Programming visualizers
- Backtracking visualizers
- Greedy Algorithm visualizers
- Bit Manipulation visualizers