Sorting Algorithms and Complexities
- n is the number of elements
- k is the number of distinct objects
Algorithm | Time Complexity | Space Complexity |
Bubble sort | ![]() |
![]() ![]() |
Insertion sort | ![]() |
![]() ![]() |
Selection sort | ![]() |
![]() ![]() |
Merge sort | ![]() |
![]() ![]() |
Heap sort | ![]() |
![]() ![]() |
Quicksort | ![]() ![]() |
![]() |
Introsort | ![]() |
![]() ![]() |
Counting sort | ![]() |
![]() |
Timsort | ![]() ![]() |
![]() |
文章出处:http://www.algorithmist.com/index.php/Sorting