Sorting Comparisons: n(n−1)/2 vs n · log₂ n and One Traced Pass
This lesson is part of the course
In this lesson
You count the comparisons of a simple sort and a merge-style sort up to a million items, then trace one pass of a neighbour-swapping sort on eight values and see the largest value travel to the end.
Buy the course once for $9.99 to unlock every lesson and lab, the final exam and the certificate – lifetime access, no subscription.
Lessons in this course
- Counting Steps: Single, Nested and Halving Loops Locked
- Growth Tables: n log n, n², 2ⁿ and Where the Curves Cross Locked
- Linear vs Binary Search: Worst-Case Comparisons and a Traced Search Locked
- Sorting Comparisons: n(n−1)/2 vs n · log₂ n and One Traced Pass Locked
- Time Budgets: Steps per Second, Run Times and the Largest n in One Second Locked
- Hash Tables: Load Factor, Expected Probes and Resize Thresholds Locked
- Caching: Hit Rates, Average Access Time and Cache Size Locked
- Dynamic Arrays & Amortised Cost, Capstone: Choose the Algorithm Locked