Sorting
Putting data in order — the classic algorithms, when each wins, and sorting as a first step.
This topic is part of Pro.
Free covers the C and Python courses, the first three DSA topics, the opening system design lessons and the beginner AI lessons, all with the full coach. Pro opens the rest of the library in the FollowtheDamnCode app.
What is in it
- 1The simple sortsBubble, selection, and insertion sort — O(n²), but insertion sort still earns its place. Pro
- 2Merge sort and quicksortThe two O(n log n) workhorses — one splits then merges, the other partitions then splits. Pro
- 3Counting, bucket, and radix sortBeat O(n log n) when values come from a small range — count instead of compare. Pro
- 4Sorting in practiceBuilt-in sorts, custom comparators, sort keys, and the Dutch national flag partition. Pro