4 ms·
The text does not differentiate between worst-case and average-case analysis. Quicksort is worst-case O(n^2), but average-case O(n logn). Yes, I know the text s
by scott_s 10y ago
The text does not differentiate between worst-case and average-case analysis. Quicksort is worst-case O(n^2), but average-case O(n logn). Yes, I know the text says "on average" in parenthesis, but that's not going to help a reader understand what that means. For an article that is meant to prepare people for a technical interview, I think it's important to make this kind of distinction.
The article also says that merge sort is average-case O(n logn), which is true, but is likely to confuse readers, as merge sort is also worst-case O(n logn).