5 questions to test your understanding
A developer claims to have written a comparison-based sorting algorithm with O(n) worst-case runtime. What does the decision-tree lower bound tell you about this claim?
Why can't counting sort be used to sort arbitrary comparable objects, such as user-defined records sorted by a custom comparator?
The Ω(n log n) sorting lower bound proves that no sorting algorithm can run faster than O(n log n) in the worst case.
The decision-tree argument works because a binary tree of height d has at most 2^d leaves, and a correct sorting algorithm must be able to produce any of the n! permutations of the input.
Explain why radix sort requires a *stable* sub-sort at each digit position. What goes wrong if an unstable sort is used?