Algorithms & Data Structures
Concept-first visualizers for the classics. Pick an algorithm, feed it your own input, and watch it execute step by step.
Sorting
3Bubble Sort
SortingRepeatedly compares adjacent pairs and swaps them if out of order. After each full pass the largest remaining element 'bubbles' to the end.
Merge Sort
SortingDivide-and-conquer sort: recursively split the array in half, sort each half, then merge the two sorted halves back together in linear time.
Quick Sort
SortingPick a pivot, partition elements into 'less than' and 'greater than' groups, then recursively sort each partition. Uses Lomuto partitioning here.
Searching
1Graph
6Breadth-First Search
GraphExplore a graph layer by layer using a queue. Guarantees shortest path in an unweighted graph because nodes are visited in order of their distance from the source.
Depth-First Search
GraphExplore a graph as deeply as possible before backtracking. Uses a stack (or recursion). Natural fit for topological sort, cycle detection, and maze exploration.
Dijkstra's Shortest Path
GraphGreedy single-source shortest path on non-negative weighted graphs. Always expands the unvisited node with the smallest tentative distance, relaxing edges to its neighbours.
Grid BFS (flood fill)
GraphBFS on a 2D grid — the shortest-path workhorse behind maze solving and flood fill. Each walkable cell is a node; edges connect 4-neighbours. Shortest path by cell count is guaranteed.
Grid DFS (recursive)
GraphDFS on a 2D grid — explores as far as possible along one direction before backtracking. Great for maze generation, connected-component labelling, and 'can I reach X?' checks.
Grid Dijkstra (weighted cells)
GraphDijkstra on a grid where each cell has its own entry cost (digit 1–9). Finds the lowest-total-cost path from S to E. '.' cells cost 1, walls '#' are blocked.
Tree
2BST Insertion
TreeInsert values into a Binary Search Tree one at a time. At each node, go left if the new value is smaller, right if larger — place it in the first empty slot.
BST Traversal (in / pre / post)
TreeDepth-first traversals of a binary search tree. In-order yields sorted values; pre-order is useful for copying; post-order for tree deletion and expression evaluation.
Data Structure
2Linked List Operations
Data StructureAppend, prepend, delete, and reverse operations on a singly linked list. Reversal flips every next-pointer with three moving references (prev / curr / next).
Stack (LIFO)
Data StructureA stack is a Last-In-First-Out container. push adds to the top, pop removes from the top, peek reads the top without removing. All three operations are O(1).