Start here · Essential guide
What Is the Most Efficient Sorting Algorithm?
There is no single most efficient sorting algorithm. Compare merge sort, heapsort, quicksort, Timsort and radix sort by worst case, stability and memory to choose.
Algorithms
Which sorting algorithms are fastest and slowest, and how Timsort, quicksort and selection sort compare.
Start here · Essential guide
There is no single most efficient sorting algorithm. Compare merge sort, heapsort, quicksort, Timsort and radix sort by worst case, stability and memory to choose.
For the standard version, yes: selection sort always does about n²/2 comparisons, so its running time is O(n²) for any input order, including sorted lists.
On random data, Timsort is usually not faster than quicksort. On data with existing runs, it can be faster, and its worst case is O(n log n), unlike quicksort's O(n²).
There is no official answer. Bogosort shuffles until the list is sorted, so its running time has no upper bound, and slowsort was built to be slow on purpose.
A sort is stable if equal items keep their original order. Insertion sort, merge sort and Timsort are stable; selection sort, heapsort and quicksort are not.
Related topics