Algorithm |
Average Time |
Worst Time |
Space |
---|---|---|---|
Bubble sort |
n^2 |
n^2 |
1 |
Selection sort |
n^2 |
n^2 |
1 |
Counting Sort |
n+k |
n+k |
n+k |
Insertion sort |
n^2 |
n^2 |
|
Quick sort |
n log(n) |
n^2 |
|
Merge sort |
n log(n) |
n log(n) |
depends |