11 lessons · pick a concept and watch the visualizer animate every execution step.
Recursion
A function that calls itself to solve a smaller version of the same problem. Each call gets its own stack frame — watch the call stack grow then unwind.
Start lesson →Divide & Conquer
Split a problem in half, solve each half recursively, then combine the results. Binary search is the classic example — each step halves the search space.
Start lesson →Greedy Algorithms
Make the locally optimal choice at each step, trusting that a sequence of greedy choices leads to a globally optimal solution. Coin change illustrates this perfectly.
Start lesson →Backtracking
Explore all candidate solutions incrementally, abandoning a path the moment it can't lead to a valid answer. Finds the first subset that sums to a target.
Start lesson →Brute Force
Try every possible option until you find the answer. Guaranteed to work, but slow. A useful baseline before optimising to a smarter algorithm.
Start lesson →Arrays & Strings
The most fundamental data structure. A contiguous block of indexed slots. The two-pointer technique solves many array problems in linear time.
Start lesson →Stacks & Queues
Two opposing access patterns built on arrays. A stack is LIFO (last in, first out); a queue is FIFO (first in, first out). Both are O(1) for their core operations.
Start lesson →Hash Tables
Map keys to values in O(1) average time using a hash function. Here we simulate one with parallel key/value arrays so the visualizer can show each lookup step.
Start lesson →Linked Lists
A sequence of nodes where each node holds a value and a pointer to the next node. We simulate nodes with parallel arrays — val[] stores values and nxt[] stores the next-node index (–1 = null).
Start lesson →Binary Trees
A tree where every node has at most two children. We store it in an array (BFS order): the root is at index 0, and the children of node i are at 2i+1 and 2i+2. In-order traversal of a BST visits nodes in sorted order.
Start lesson →Graphs & BFS
A graph is a set of nodes connected by edges. BFS explores the graph layer by layer using a queue. We encode edges in a compact adjacency array (CSR format) and simulate the queue with an array and head/tail indices.
Start lesson →