Sorting Algorithms
Selection Sort
O(n^2) In place Not Stable Not Adaptive
Quicksort
O(n^2) worst-case time (average nlogn) best nlogn *pick a pivot *place all smaller items to left, larger to the right in place not stable not adaptive
Adaptive Sorting
Running time can be improved by taking advantage of certain input arrangements
In-Place Sorting
The list itself is rearranged and only a constant amount of space is required.
Mergesort
n log n Not in place Stable Not adaptive
Insertion Sort
Best: O(n) Average: O(n^2) Worst: O(n^2) Inplace stable adaptive
Stable Sorting Algorithm
Items with the same key are sorted based on their relative position in the original permutation