Searching, Sorting & Selection
![Question 2(ix), GATE 1992: Which listed method sorts n integers in [1, n³] in O(n): heapsort, quicksort, mergesort, radix sort?](../../assets/questions/CS-1992-Q19-1.webp)
![Question 2(ix), GATE 1992: Which listed method sorts n integers in [1, n³] in O(n): heapsort, quicksort, mergesort, radix sort?](../../assets/questions/CS-1992-Q19-2.webp)
Answer & solution
Answer: D: radix sort (no official key was published)
Subtract one to put keys in [0, n³−1], then represent each in base n using three digits. Stable counting sort of one digit takes O(n+n)=O(n) time and O(n) auxiliary storage, so three least-significant-digit passes remain linear. Comparison sorts retain their general Ω(n log n) worst-case comparison barrier on arbitrary distinct keys; the integer representation lets radix sorting escape that model. The bound assumes word operations and digit extraction on these O(log n)-bit keys take constant time.