2023 · Personal

Algorithm Debunker

A step-through visualiser for eight sorting algorithms, from bubble sort to heap sort. Enter your own numbers, then step forwards and backwards or let it auto-play while each comparison and swap is highlighted.

  • JavaScript
  • HTML
  • CSS

About this project

Algorithm Debunker shows what a sorting algorithm actually does to your numbers, one comparison at a time.

Pick one of eight algorithms (bubble, insertion, selection, quick, merge, counting, bucket, or heap sort), type in your own list, and start. Each stage is recorded, so you can step forwards and backwards, jump to any stage from the timeline, or let it auto-play at a speed you choose. Elements being compared, swapped, or settled are coloured differently. Each algorithm has its own detail page explaining how it works.

It was written in plain JavaScript with no libraries. Recording every stage up front, rather than animating while sorting, is what made stepping backwards possible.