26 visualizers

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

6

Searching

2

Graph

8

Breadth-First Search

Graph

Explore 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.

time O(V + E)

Depth-First Search

Graph

Explore as far along one branch as possible before backtracking, using a stack. Visits the same nodes as BFS but in a completely different order.

time O(V + E)

Dijkstra's Shortest Path

Graph

Greedy single-source shortest path on non-negative weighted graphs. Always expands the unvisited node with the smallest tentative distance, relaxing edges to its neighbours.

time O((V + E) log V)

Topological Sort (Kahn's algorithm)

Graph

Order the nodes of a directed graph so every edge points forwards — build order, course prerequisites, task scheduling. Repeatedly take a node nothing depends on, and remove it. If anything is left over, the graph had a cycle.

time O(V + E)

Kruskal's Minimum Spanning Tree

Graph

Connect every node as cheaply as possible: sort the edges by weight and take each one unless it would close a cycle. Union-find answers 'would this close a cycle?' in near-constant time.

time O(E log E)

Grid BFS (flood fill)

Graph

BFS 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.

time O(rows × cols)

Grid DFS (recursive)

Graph

DFS 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.

time O(rows × cols)

Grid Dijkstra (weighted cells)

Graph

Dijkstra 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.

time O(rows × cols × log(rows × cols))

Tree

3

Data Structure

2

DP

4

String

1