Sorting Flashcards
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)