Sorting Flashcards
(31 cards)
Best , average, worst time of quicksort
Best: Ω(n log(n))
Average: Θ(n log(n))
Worst: O(n^2)
Worst space compl of quicksort
O(log(n))
Merge sort time best, avg, worst
Mergesort
Ω(n log(n))
Θ(n log(n))
O(n log(n))
Merge sort space worst
O(n)
Timsort best, avg, worst time
TimsortΩ(n)Θ(n log(n))O(n log(n))
Timsort worst space
O(n)
Heapsort b,a,w time
HeapsortΩ(n log(n))Θ(n log(n))O(n log(n))
Heapsort worst space
O(1)
Bubble sort b, a, worst time
Bubble SortΩ(n)Θ(n^2)O(n^2)
Bubble sort worst space
o(1)
Insertion sort b,a ,w time
Insertion SortΩ(n)Θ(n^2)O(n^2)
Inesrtion sort w space
O(1)
Selection sort b,a,w time
Selection SortΩ(n^2)Θ(n^2)O(n^2)
Selection sort worst space
O(1)
Tree sort time b,a,w
Tree SortΩ(n log(n))Θ(n log(n))O(n^2)
Tree sort worst space complexity
O(n)
Shell sort b,a,w time
Shell SortΩ(n log(n))Θ(n(log(n))^2)O(n(log(n))^2)
Shell sort worst space
O(1)
Bucket sort b,a,w time
Bucket SortΩ(n+k)Θ(n+k)O(n^2)
Bucket sort worst space
O(n)
Radix sort b,a,w time
Radix SortΩ(nk)Θ(nk)O(nk)
Radix sort worst space
O(n+k)
Counting sort b,a,w time
Counting SortΩ(n+k)Θ(n+k)O(n+k)
Counting sort worst space
O(k)