Skip to content
Build With Owais
Free · no sign-up · 15 algorithms

Interactive Algorithm Playground

Learn sorting, searching and graph algorithms through beautiful interactive visualizations.

The best place to start — one from each major strategy, each with a full visualiser and a written guide.

Bubble Sort

Beginner

Repeatedly swap adjacent pairs until the largest values have bubbled to the end.

Average
O(n²)
Worst
O(n²)
Space
O(1)
  • Stable
  • Comparison
  • In place
Start learning

Insertion Sort

Beginner

Grow a sorted prefix by sliding each new value back to where it belongs.

Average
O(n²)
Worst
O(n²)
Space
O(1)
  • Stable
  • Comparison
  • In place
Start learning

Merge Sort

Intermediate

Split the array down to single elements, then merge sorted halves back together.

Average
O(n log n)
Worst
O(n log n)
Space
O(n)
  • Stable
  • Comparison
  • Out of place
Start learning

Quick Sort

Intermediate

Partition around a pivot so everything smaller lands left and larger lands right.

Average
O(n log n)
Worst
O(n²)
Space
O(log n)
  • Unstable
  • Comparison
  • In place
Start learning

Binary Search

Beginner

Halve a sorted range on every comparison — a million elements in twenty checks.

Average
O(log n)
Worst
O(log n)
Space
O(1)
  • Searching
Start learning

Breadth-First Search

Intermediate

Explore a graph level by level with a queue — the shortest path on unweighted edges.

Average
O(V + E)
Worst
O(V + E)
Space
O(V)
  • Graph Algorithms
Start learning

Dijkstra's Algorithm

Advanced

Greedily settle the nearest unvisited node to get shortest paths on non-negative weights.

Average
O((V + E) log V)
Worst
O((V + E) log V)
Space
O(V)
  • Graph Algorithms
Start learning

Browse by category

Sorting

Put a collection in order. The classic proving ground for comparing algorithmic strategies.

8 algorithms available

Searching

Find a value inside a collection — and see exactly what sorted order buys you.

2 algorithms available

Graph Algorithms

Traverse networks, find shortest paths, and build minimum spanning trees.

5 algorithms available

Tree AlgorithmsComing soon

Binary search trees, traversals, AVL rotations and heaps.

Dynamic ProgrammingComing soon

Knapsack, LCS, edit distance and the art of reusing subproblems.

Every algorithm

Search by name, by what it does, or by complexity. Each card opens a full page with an interactive visualiser, pseudo code, implementations in five languages, and a written explanation.

15 algorithms shown.

  • Bubble Sort

    Beginner

    Repeatedly swap adjacent pairs until the largest values have bubbled to the end.

    Average
    O(n²)
    Worst
    O(n²)
    Space
    O(1)
    • Stable
    • Comparison
    • In place
    Start learning
  • Selection Sort

    Beginner

    Scan for the smallest remaining value and swap it into place — one swap per pass.

    Average
    O(n²)
    Worst
    O(n²)
    Space
    O(1)
    • Unstable
    • Comparison
    • In place
    Start learning
  • Insertion Sort

    Beginner

    Grow a sorted prefix by sliding each new value back to where it belongs.

    Average
    O(n²)
    Worst
    O(n²)
    Space
    O(1)
    • Stable
    • Comparison
    • In place
    Start learning
  • Merge Sort

    Intermediate

    Split the array down to single elements, then merge sorted halves back together.

    Average
    O(n log n)
    Worst
    O(n log n)
    Space
    O(n)
    • Stable
    • Comparison
    • Out of place
    Start learning
  • Quick Sort

    Intermediate

    Partition around a pivot so everything smaller lands left and larger lands right.

    Average
    O(n log n)
    Worst
    O(n²)
    Space
    O(log n)
    • Unstable
    • Comparison
    • In place
    Start learning
  • Heap Sort

    Advanced

    Build a max-heap, then repeatedly pull the root to the end of the array.

    Average
    O(n log n)
    Worst
    O(n log n)
    Space
    O(1)
    • Unstable
    • Comparison
    • In place
    Start learning
  • Counting Sort

    Intermediate

    Count how many times each value occurs, then write the output straight from the tallies.

    Average
    O(n + k)
    Worst
    O(n + k)
    Space
    O(n + k)
    • Stable
    • Non-comparison
    • Out of place
    Start learning
  • Radix Sort

    Advanced

    Sort by one digit at a time, least significant first, using a stable counting pass.

    Average
    O(d·(n + k))
    Worst
    O(d·(n + k))
    Space
    O(n + k)
    • Stable
    • Non-comparison
    • Out of place
    Start learning
  • Linear Search

    Beginner

    Check every element in order until the target turns up — no assumptions required.

    Average
    O(n)
    Worst
    O(n)
    Space
    O(1)
    • Searching
    Start learning
  • Binary Search

    Beginner

    Halve a sorted range on every comparison — a million elements in twenty checks.

    Average
    O(log n)
    Worst
    O(log n)
    Space
    O(1)
    • Searching
    Start learning
  • Breadth-First Search

    Intermediate

    Explore a graph level by level with a queue — the shortest path on unweighted edges.

    Average
    O(V + E)
    Worst
    O(V + E)
    Space
    O(V)
    • Graph Algorithms
    Start learning
  • Depth-First Search

    Intermediate

    Follow one branch as deep as it goes, then backtrack — a stack, or recursion.

    Average
    O(V + E)
    Worst
    O(V + E)
    Space
    O(V)
    • Graph Algorithms
    Start learning
  • Dijkstra's Algorithm

    Advanced

    Greedily settle the nearest unvisited node to get shortest paths on non-negative weights.

    Average
    O((V + E) log V)
    Worst
    O((V + E) log V)
    Space
    O(V)
    • Graph Algorithms
    Start learning
  • Prim's Algorithm

    Advanced

    Grow a minimum spanning tree outward from one node, always taking the cheapest edge out.

    Average
    O(E log V)
    Worst
    O(E log V)
    Space
    O(V)
    • Graph Algorithms
    Start learning
  • Kruskal's Algorithm

    Advanced

    Sort every edge by weight and add the cheap ones that don't close a cycle.

    Average
    O(E log E)
    Worst
    O(E log E)
    Space
    O(V)
    • Graph Algorithms
    Start learning

How to actually learn an algorithm

Most people learn algorithms in the wrong order. They memorise the complexity table first, then try to reverse-engineer the mechanism from it. That works for passing a quiz and fails the moment an interviewer asks why quick sort degrades to O(n²), because the answer lives in the mechanism, not the table.

A better order is this. First, watch the algorithm run on ten elements slowly enough to narrate what it is doing out loud. Second, find its invariant — the one sentence that is true after every pass, like “the last k elements are the k largest, in final order”. Third, work out what the invariant costs: how many comparisons are needed to maintain it, and how that count grows as the array does. Only then does the complexity table mean anything, because by that point you are reading a summary of something you already understand.

The fourth step is the one people skip: run the algorithm on the input designed to hurt it. Every visualiser here lets you choose a reversed or nearly-sorted array precisely for this. Watching insertion sort finish a nearly-sorted array in one pass, and then watching it crawl through a reversed one, teaches the difference between best and worst case in about fifteen seconds — considerably faster than reading two paragraphs about it, this one included.

What the colours mean

Across every sorting visualiser the code is the same: amber is a comparison in progress, coral is a swap or a write, mint means an element has reached its final position, and white marks a pivot or the current minimum. Elements still in play stay violet. Graph visualisers use the same palette — amber for the node being processed, mint for visited, coral for the final path.

Where to go next

Once two algorithms make sense individually, put them side by side on the comparison page and run them on the same array. Seeing bubble sort still grinding through its two-thousandth comparison while quick sort has already finished is the single most persuasive argument for asymptotic analysis I know of.

If you are learning this to build a career rather than to pass a course, the 90-day developer roadmap covers what to do with these fundamentals once you have them, and the other free developer tools here handle the day-to-day jobs — JSON, JWTs, hashing and passwords.

Algorithm Playground FAQ

A visualiser turns each step an algorithm takes into something you can see and control. Reading that quick sort partitions around a pivot is abstract; watching the pivot land and both sides collapse inward makes the mechanism concrete. Every visualiser here also reports the real comparison and swap counts, so the complexity you read about is a number you can watch grow.

Yes — completely free, with no sign-up, no account and no limits. Everything runs in your browser; nothing you type is sent anywhere.

Start with bubble sort to get comfortable with the idea of an invariant, move to insertion sort and selection sort to see different strategies for the same problem, then jump to merge sort and quick sort for divide and conquer. Binary search is worth doing early too — it is short, and it is the clearest demonstration of what logarithmic time actually buys you.

Yes. Every sorting and searching visualiser accepts a custom array — type comma-separated values and press Apply. The graph visualisers let you add and delete edges, drag nodes and pick your own start and destination, so you can build the exact case you are trying to understand.

They come from the algorithm itself. Each visualiser runs the real implementation once and records every comparison, swap and array access as it happens, then replays that recording. The counters are literal counts, not estimates. The one figure labelled as an estimate is memory, because a JavaScript engine's true footprint is not observable from inside the page.

Yes. The visualisers are responsive, the graph canvas supports touch dragging, and every control is a real button sized for a thumb. On a small screen, use fewer array elements — 10 to 20 — so individual bars stay readable.

They are correct, idiomatic reference implementations meant for learning. In real projects you should almost always call your language's built-in sort, which will be a heavily tuned hybrid such as Timsort or introsort. Write these yourself to understand them, not to ship them.
Start a project

Tell me what you're building

Share a few details and I'll come back within one business day with an honest take, a realistic timeline and a ballpark cost — no pressure, no sales script.

  • Reply within one business day, from me directly
  • Straight answers on scope, timeline and budget
  • Free 30-minute consultation, no obligation

Need a developer who understands what's under the abstraction?

Tell me what you're working on. I'll reply within one business day with honest, practical next steps.