Which of the following uses the largest amount of auxiliary space for sorting?

Which of the following uses the largest amount of auxiliary space for sorting?
A. Bubble sort
B. Counting sort
C. Quick sort
D. Heap sort
 
Answer: b
Explanation: Counting sort requires auxiliary space of O(n+k) whereas quick sort, bubble sort and heap sort are in place sorting techniques. Thus counting sort requires most auxiliary space.
 

Tìm kiếm

Back
Top