Which of the following sorting algorithms is stable, non-comparison based and…
2025
Which of the following sorting algorithms is stable, non-comparison based and works best when input is uniformly distributed?
- A.
Selection sort
- B.
Bucket sort
- C.
Shell sort
- D.
Quick sort
Attempted by 59 students.
Show answer & explanation
Correct answer: B
Bucket sort is the correct choice because it is a non-comparison based sorting algorithm that achieves linear time complexity O(n+k) when input data is uniformly distributed. Unlike comparison-based algorithms such as Quick sort or Merge sort, Bucket sort distributes elements into buckets and sorts them individually without comparing every pair of values.