Searching and sorting algorithms in practice
8 steps · about 3 h 15 min · Beginner
- Algorithmic efficiency and Big O notation (article, Wikipedia, 25 min)
Evaluate worst-case, best-case, and average-case runtimes as input sizes scale asymptotically.
- Sequential linear search across unsorted collections (article, Wikipedia, 15 min)
Understand baseline O(n) element inspection when no ordering guarantees exist.
- Divide-and-conquer binary search on sorted arrays (article, Wikipedia, 25 min)
Halve search spaces repeatedly to achieve logarithmic O(log n) lookup efficiency.
- Overview and properties of comparison sorting algorithms (article, Wikipedia, 20 min)
Compare stability, in-place memory usage, and theoretical lower bounds for comparison sorts.
- Bubble sort mechanics and adjacent pair swapping (article, Wikipedia, 20 min)
Study quadratic O(n^2) neighbor exchange sorting and early-termination optimizations.
- Insertion sort for incremental online data streams (article, Wikipedia, 25 min)
Build sorted subarrays element-by-element, achieving high efficiency on nearly sorted data.
- Merge sort: recursive divide-and-conquer with stable guarantees (article, Wikipedia, 30 min)
Split arrays recursively and merge sorted halves to guarantee predictable O(n log n) runtime.
- Quicksort: pivot selection, partitioning, and in-place sorting (article, Wikipedia, 35 min)
Implement Hoare or Lomuto partitioning schemes for high cache-friendly practical sorting speed.