Q: Which of the following sorting algorithms is not a comparison-based algorithm?
-
A
Bucket sort
-
B
Merge sort
-
C
Selection sort
-
D
Quick sort
A
Answer:
A
Explanation:
Bucket sort is not a comparison-based algorithm; instead, it distributes elements into a number of buckets and then sorts these buckets individually. This method takes advantage of the properties of the input data and can achieve linear time complexity under certain conditions. In contrast, merge sort, selection sort, and quick sort are all comparison-based algorithms that determine the order of elements by comparing them.
Related Topic:
Share Above MCQ