Which of the following sorting algorithm is not stable __________

Khánh Đoan

New member
Which of the following sorting algorithm is not stable __________
A. insertion sort
B. bubble sort
C. merge sort
D. bogosort
 
Answer: d
Explanation: Out of the given algorithms only bogosort is not stable. This is because it creates permutations of the input array in order to obtain the sorted version. So there is no guarantee that the sorted version obtained by such a method gives a stable output.
 

Tìm kiếm

Back
Top