A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
1–10 of 13 posts
Re: A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
#2I really like the randomization solution. Worst case? What worst case?
Re: A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
#3> An attempt to solve this problem has been randomization as shown already in Hoare’s first articles on Quicksort [1]. On the other hand, this does not change the statistical probability for bad cases. I really like the randomization solution. Worst case? What worst case?
Re: A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
#4Re: A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
#5EDIT: I wrote worst case #permutations. That's the best case #comparisons. So, no, I don't mean a sorted sequence ;)
Re: A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
#6Re: A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
#7I 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 app…
Re: A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
#8I 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 app…
A much more interesting case is the median-of-three pivot. (Namely, median of first / middle / last elements). You can still do it, however.
Re: A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
#9If Quicksort worst case performance is a problem then use Introsort ( https://en.wikipedia.org/wiki/Introsort ), which the paper fails to mention.
Re: A numerical analysis of Quicksort: How many cases are bad cases? [pdf]
#10I 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 app…