Checkpoint 7.9.1.
- Shell Sort
- Shell sort is between \(O(n)\) and \(O(n^2)\)
- Quick Sort
- Quick sort can be \(O(n \log n)\text{,}\) but if the pivot points are not well chosen and the list is just so, it can be \(O(n^2)\text{.}\)
- Merge Sort
- Correct! Merge Sort is the only guaranteed \(O(n \log n)\) even in the worst case. The cost is that merge sort uses more memory.
- Insertion Sort
- Insertion sort is \(O(n^2)\)
Which of the following sort algorithms are guaranteed to be \(O(n \log n)\) even in the worst case?