InterviewSolution
Saved Bookmarks
| 1. |
Which of the following sorting algorithm is stable?(a) Selection sort(b) Quick sort(c) Binary insertion sort(d) Heap sortThis question was addressed to me by my college professor while I was bunking the class.The origin of the question is Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» RIGHT OPTION is (c) Binary INSERTION sort The best 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. |
|