Which of the following sorting algorithm is stable?

Which of the following sorting algorithm is stable?
A. Selection sort
B. Quick sort
C. Binary insertion sort
D. Heap sort
 
Answer: c
Explanation: Out of the given options binary insertion sort is the only algorithm which is stable. It is because the elements with identical values appear in the same order in the output array as they were in the input array.
 

Tìm kiếm

Back
Top