Interactive step-by-step visualizations of common data structures and algorithms. Watch how they work, understand the logic, and learn by seeing.
Find two numbers that add up to a target using a hashmap approach.
HashMapSort an array of 0s, 1s, and 2s in-place using three pointers.
Dutch National FlagFind the contiguous subarray with the largest sum.
Kadane's AlgorithmMaximize profit by finding the best buy and sell days.
Single PassQuickSort with Dutch National Flag 3-way partitioning.
Divide & ConquerFind the kth largest element using max heap with O(n + k log n) time.
Max HeapBuild each element's product of all others using prefix and suffix passes.
Prefix/SuffixCompute trapped water using precomputed left max and right max arrays.
Left/Right MaxFind a pattern in text efficiently using prefix table.
Knuth-Morris-PrattFind the longest palindrome within a string.
Expand Around CenterGroup words with the same character frequencies using a hashmap.
HashMapByte Pair Encoding: iteratively merge frequent byte pairs into tokens.
TokenizationConvert a non-negative integer to its English word representation.
RecursionCount distinct islands in a 2D grid using graph traversal.
DFS / BFSFill connected pixels with a new color starting from a point.
BFSFind the shortest clear path in a binary matrix using 8-directional BFS.
BFSFind if a word exists in a 2D grid using DFS with backtracking.
DFS / Backtracking