DSA Visualized
← All topics
sort

Sorting

Putting things in order, and why how matters.

01

Bubble Sort

Compare neighbours, swap if they're wrong. Repeat until calm.

play_circle
02

Selection Sort

Find the smallest. Put it in front. Repeat.

play_circle
03

Insertion Sort

How you actually sort a hand of cards, without being taught.

play_circle
04

Merge Sort

Split until it's trivial, then merge back in order.

play_circle
05

Quick Sort

Pick a pivot, split around it, and let the halves sort themselves.

play_circle
06

Heap Sort

Turn the array into a heap, then keep taking the biggest off the top.

play_circle
07

Shell Sort

Insertion sort, but values are allowed to leap instead of crawl.

play_circle
08

Counting Sort

Sorts without comparing anything — and that's how it beats n log n.

play_circle
09

Radix Sort

Sort by the last digit first. It sounds backwards, and it's the only way it works.

play_circle