I remember, at uni, in the second semester, we had an assignment to specifically craft a sequence of n numbers 1..n that would trigger the worst case (#permutations) in a quicksort algorithm that always takes the first number in the array as the pivot. It was a nightmare. I spent days on it, and I was barely able to scrape together a notation to specify such a series. Turns out the sample solutions were like "The appropriate sequence is not easy to write. The sequence must be designed such that every chosen pivot halves the area that will be stored." Well, yeah.<p>EDIT: I wrote worst case #permutations. That's the best case #comparisons. So, no, I don't mean a sorted sequence ;)