Honest Take — Before You Begin
There's a reason every algorithms course starts with sorting. It's not because sorting is the most important thing computers do (though it's up there). It's because sorting is the…
Master the canonical sorting algorithms (insertion sort through quicksort and mergesort), binary search and its variations, and the fundamental algorithmic techniques that appear in every technical interview.
Ruby's Array#sort uses Timsort (since Ruby 2.7) — a hybrid of merge sort and insertion sort optimized for real-world data with natural runs. Understanding why Timsort beats pure mergesort on practical data teaches you that theoretical optimality and practical performance are different things. In Rails, order(:created_at) pushes sorting to the database (which uses its own optimized sort algorithms on indexed B-trees). Understanding when to sort in Ruby vs. in SQL is a production performance decision: sort in SQL when the data is indexed, sort in Ruby when you need custom comparison logic or when data is already in memory.
This course unlocks once you've finished its prerequisite. Open prerequisite →
There's a reason every algorithms course starts with sorting. It's not because sorting is the most important thing computers do (though it's up there). It's because sorting is the…
Approach: READ: Ch 1-3 (foundations, growth, recurrences), Ch 6 (heapsort), Ch 7 (quicksort), Ch 8 (linear-time sorting), Ch 9 (medians/order statistics)
Approach: READ: Ch 1-2 (intro + algorithm analysis), Ch 3 (data structures review), Ch 4 (sorting and searching)
Approach: CODE ALONG: implement each sort in Ruby
Work through each item before the checkpoint.
Implement a Ruby sorting benchmark suite that compares all your implementations against Array#sort on random, sorted, reverse-sorted, and nearly-sorted inputs of sizes 1K to 1M. W…
6 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.