When will the worst case of Merge Sort occur?
问题 I know that worst case on mergesort is O(nlogn), the same as the average case. However, if the data are ascending or descending, this results to the minimum number of comparisons , and therefore mergesort becomes faster than random data. So my question is: What kind of input data produces the maximum number of comparisons that result to mergesort to be slower? The answer at this question says: For some sorting algorithms (e.g. quicksort), the initial order of the elements can affect the