Skip to content
On this page

Collection

Sorting and recursion Experience it live.

Sorting algorithms racing and blindfolded, quicksort and its partitions, heapsort, plus the call stack and call tree of recursion.

8 VisuApps
See the apps

App catalogue

Apps

All apps. Free in your browser.

Sorting in the dark

Sorting in the dark

Eight wooden tiles lie face down in a tray, the numbers are on the underside. Tap two to turn them over: that is one comparison; then swap them or put them back. A mechanical counter counts comparisons and swaps. “Done” turns everything over and puts your count next to Insertion, Bubble, Selection, Merge, Heap and Quicksort on the same numbers, along with the lower bound of 16 comparisons for 8 tiles. The five algorithms that need no second list also run step by step on the tiles. Your own numbers (4 to 12), templates and three tasks; in strict mode a comparison only shows which tile is larger.

Computer scienceTry it
Quicksort: Partitions

Quicksort: Partitions

Quicksort as on the slides: the last element becomes the pivot, every element before it goes into the first or second partition with one sentence, the pivot swaps in between and stays at its correct position. Then the sub-ranges with the same method, including trivial and empty ones. Tiles glide when swapped, below them a staircase of the calls; Python code with the running line, counters, predictions. Example 2, 7, 6, 8, 4, 1, 3, 5 with 13 comparisons; sorted and reversed input are the worst case with n(n−1)/2.

Computer scienceTry it
Heapsort

Heapsort

Heapsort as on the slides: at the top the list as a binary tree, below it the same list as a row of tiles; a swap moves both. Tapping shows the index calculation (parent (i-1)//2, children 2*i+1 and 2*(i+1)). Build heap checks every parent from back to front and swaps down with the larger child; then, round by round, the largest element moves to the back and detaches from the tree. The sentence of the slide for every step, Python code with the running line, counters, predictions. Example 8, 5, 16, 4, 9, 12, 11, 3, 1 with 21 swaps, 3 of them in build heap.

Computer scienceTry it
Mergesort

Mergesort

Mergesort as in the lecture program: a tree of sublists grows step by step, first the left half completely, then the right, then merge; the edges are numbered as on the exercise sheets. Next to it the merge in large: two sorted lists, their front elements, the target list with free slots and travel lines, one sentence per step. Python code with the running line, counters, predictions, a level view for counting. Example 11, 9, 2, 6, 4, 3, 1, 7, 8 with 17 comparisons; always O(n log n), Quicksort alongside.

Computer scienceTry it
Call Tree

Call Tree

Your own Python as a growing call tree: real Python 3.13 runs in the browser (Pyodide, served by heyprof itself), and every function call becomes a node with its arguments, local variables and return value. The tree grows depth-first, the running node is filled, the waiting ones form the call stack beside it, and return values only appear on the way back up. Eight examples from factorial via Hanoi to merge sort, steps per call or per line, predictions, and exceptions that travel up through the frames.

Computer scienceTry it

Collections

More collections. Curated by us.

New ideas for your teaching.

Want to use these apps in your courses? Let’s find out what works for you.

Tell us what this is about

One form, three matters. We answer personally.

What is this about?

We show heyprof on your own material. Tell us what you teach and we will prepare the conversation around it.

Your details

Where do you teach? (optional)

What comes back

Only when something new for your subject is ready. You will first get a mail with a confirmation link — without that click we do not add you, and we discard the address after a few days. Every later mail carries an unsubscribe link.

What happens next

  • A confirmation to your address, right away.
  • An answer from us, usually within two working days.
  • No phone call, nothing passed on to third parties.

We use your details only to answer you. Privacy policy