Sorting Algos Flashcards
1
Q
Quicksort Time Complexity
A
Best: O(n log(n))
Avg: O(n log(n))
Worst: O(n^2)
2
Q
Mergesort Time Complexity
A
Best/Avg/Worst: O(n log(n))
3
Q
Heapsort Time Complexity
A
Best/Avg/Worst: O(n log(n))
4
Q
Bubble Sort Time Complexity
A
Best: O(n)
Avg: O(n^2)
Worst: O(n^2)
5
Q
Insertion Sort Time Complexity
A
Best: O(n)
Avg: O(n^2)
Worst: O(n^2)
6
Q
Selection Sort Time Complexity
A
Best: O(n^2)
Avg: O(n^2)
Worst: O(n^2)
7
Q
Radix Sort Time Complexity
A
Best/Avg/Worst: O(nk)
8
Q
Quicksort Space Complexity
A
O(log(n))
9
Q
Mergesort Space Complexity
A
O(n)
10
Q
Heapsort Space Complexity
A
O(1)
11
Q
Bubble Sort Space Complexity
A
O(1)
12
Q
Insertion Sort Space Complexity
A
O(1)
13
Q
Selection Sort Space Complexity
A
O(1)
14
Q
Radix Sort Space Complexity
A
O(n+k)