A sorting algorithm is called stable sorting algorithms if the order of the original values with same precedence is retained over in the final output.
e.g. a list of names [alex, bob, alice, judy, tom] has the output [alex, alice ,bob, judy, tom]. Here the precedence of alex over alice is retained in the output.
Sorting Algorithm that are stable:
e.g. a list of names [alex, bob, alice, judy, tom] has the output [alex, alice ,bob, judy, tom]. Here the precedence of alex over alice is retained in the output.
Sorting Algorithm that are stable:
- Bubble Sort
- Insertion Sort
- Merge Sort
- Heap Sort
- Quick Sort
No comments:
Post a Comment