Worst case for QuickSort - when can it occur?
问题 When analyzing QS, every one always refers to the "almost sorted" worst case. When can such a scenario occur with natural input? The only example I came up with is re-indexing. 回答1: I think people are confusing Quicksort the partition-based sorting algorithm, and "qsort" the various library implementations. I prefer to see Quicksort the algorithm as having a pluggable pivot selection algorithm, which is quite essential in analyzing its behavior. If the first element is always chosen as the