Sorting Algorithms Flashcards
1
Q
Bubble Sort Time Complexity
A
Best - O(n)
Average - O(n2)
Worst - O(n2)
2
Q
Insertion Sort Time Complexity
A
Best - O(n)
Average - O(n2)
Worst - O(n2)
2
Q
Bubble Sort Space Complexity
A
O(1)
3
Q
Insertion Sort Space Complexity
A
O(1)
4
Q
Merge Sort Time Complexity
A
Best - O(n log n)
Average - O(n log n)
Worst - O(n log n)
5
Q
Merge Sort Space Complexity
A
O(n)
6
Q
Quick Sort Time Complexity
A
Best - O(n log n)
Average - O(n log n)
Worst - O(n2)
7
Q
Quick Sort Space Complexity
A
O(log n)