Skip to main content

Overview

AlgorithmBest Time ComplexityWorst Time ComplexityAverage Time ComplexitySpace ComplexityStable?
Selection SortΩ(n^2)θ(n^2)O(n^2)O(1)N
Bubble SortΩ(n)θ(n^2)O(n^2)O(1)Y
Insertion SortΩ(n)θ(n^2)O(n^2)O(1)Y
Heap SortΩ(n log(n))θ(n log(n))O(n log(n))O(1)N
Quick SortΩ(n log(n))θ(n log(n))O(n^2)O(log(n))N
Merge SortΩ(n log(n))θ(n log(n))O(n log(n))O(n)Y
Bucket SortΩ(n +k)θ(n +k)O(n^2)O(n)Y
Radix SortΩ(nk)θ(nk)O(nk)O(n + k)N
Count SortΩ(n +k)θ(n +k)O(n +k)O(k)Y
Shell SortΩ(n)θ(n log(n))O(n log(n))O(1)N
Tim SortΩ(n)θ((n log(n))^2)O((n log n (n))^2)O(n)Y
Tree SortΩ(n log(n))θ(n log(n))O(n^2)O(n)Y
Cube SortΩ(n)θ(n log(n))O(n log(n))O(n)Y