Which of the following pair of sorting algorithms are stable?

Nguyễn Hào

New member
Which of the following pair of sorting algorithms are stable?
A. gnome sort and quick sort
B. merge sort and selection sort
C. gnome sort and merge sort
D. heap sort and merge sort
 
Answer: c
Explanation: Gnome sort and merge sort are stable sorting algorithms as the elements with identical values appear in the same order in the output array as they were in the input array when any of these sorting algorithms are implemented.
 

Tìm kiếm

Back
Top