InterviewSolution
Saved Bookmarks
| 1. |
Which of the following sorting algorithm is stable?(a) Selection sort(b) Quick sort(c) Insertion sort(d) Heap sortThe question was posed to me in an online quiz.The origin of the question is Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» RIGHT choice is (c) Insertion sort Best explanation: Out of the GIVEN options 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. |
|