lou.tools
EN

Algorithms, step by step

Watch each algorithm run on a list, one step at a time, with its pseudocode and its Python side by side, then test yourself with "What happens next?". Made for a first course in programming and algorithms.

By kind

Sorting

  • Bubble sort

    Watch neighbours swap until the list is sorted, with pseudocode, Python and a quiz.

    Worst case O(n²)StableIn place

  • Selection sort

    Watch each pass pick the smallest value and swap it to the front, with pseudocode, Python and a quiz.

    Worst case O(n²)In place

  • Insertion sort

    Watch each value slide left into the part already in order, with pseudocode, Python and a quiz.

    Worst case O(n²)StableIn place

  • Merge sort

    Watch the list split into halves and merge back sorted, with pseudocode, Python and a quiz.

    Worst case O(n log n)Stable

  • Quicksort

    Watch each pivot split the list and land in its final place, with pseudocode, Python and a quiz.

    Worst case O(n²)In place

Searching

  • Binary search

    Watch the range halve until the value turns up, with pseudocode, Python and a quiz.

    Worst case O(log n)

In class

Every page works on a projector and on a phone. Pick a list, play it slowly, and stop on a step to ask the class what comes next; the quiz does the same on its own, with a new random list each round.

The Python on each page is the code the simulation follows, line by line, and a test runs it on every list the page can draw.

Questions

What is on each algorithm page?
A simulation you can play, pause and step through on a list of your own; the algorithm in pseudocode and in Python with the running line lit; how it works and its complexity; and "What happens next?", a five-question quiz on a random list.
Is it free?
Yes. Every page runs in your browser, with no account, and the lists you type never leave it.
Which algorithm should I start with?
Bubble sort, then selection sort and insertion sort: all three grow a sorted part one value at a time, and seeing them side by side shows why insertion sort usually makes the fewest comparisons. Then binary search, and last merge sort and quicksort, which split the list and sort each part the same way.