What is the disadvantage of counting sort?

Mỹ Duyên

New member
What is the disadvantage of counting sort?
A. counting sort has large time complexity
B. counting sort has large space complexity
C. counting sort is not a comparison based sorting technique
D. counting sort cannot be used for array with non integer elements
 
Answer: d
Explanation: Counting sort can only be used for arrays with integer elements because otherwise array of frequencies cannot be constructed.
 

Tìm kiếm

Back
Top