Which of the following sorting algorithm is stable?

Đức Lưu

New member
Which of the following sorting algorithm is stable?
A. Selection sort
B. Quick sort
C. Bubble sort
D. Heap sort
 
Answer: c
Explanation: Out of the given options bubble 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