Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
permalink.gmane.org
Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
1–10 of 17 posts
Re: Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
#2Re: Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
#3I read the documentation he linked to. It seems odd to me that there was no mention of a N-Pivot quicksort. Unless I missed it. It seems like the burden would be on proving that 2 was the optimal value of N
Re: Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
#4I read the documentation he linked to. It seems odd to me that there was no mention of a N-Pivot quicksort. Unless I missed it. It seems like the burden would be on proving that 2 was the optimal value of N
size = 0 -> no sort
size = 1 -> no sort
size = 2 -> pivots can be made, thus can be sorted
etc.
Re: Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
#5Re: Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
#6I read the documentation he linked to. It seems odd to me that there was no mention of a N-Pivot quicksort. Unless I missed it. It seems like the burden would be on proving that 2 was the optimal value of N
Having N > 2 will require you to do a sort on the pivots :P Also you will require that the array size be at least N. N = 2 is a perfect size -- size = 0 -> no sort size = 1 -> no sort size = 2 -> pivots can be made, thus can be sorted etc.
3. P1 must be less than P2, otherwise they are swapped.Re: Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
#7Re: Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
#8Re: Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
#9Any insights into the "fat pivot" problem?
Re: Potential Quicksort replacement in java.util.Arrays with new Dual-Pivot
#10I read the documentation he linked to. It seems odd to me that there was no mention of a N-Pivot quicksort. Unless I missed it. It seems like the burden would be on proving that 2 was the optimal value of N
Using more pivots is going to make the code more complicated. The benefits of moving from one pivot to two seem to be real but not enormous; I'd be pretty surprised if moving to three pivots produced benefits worth the cost. But of course that's just handwaving, and indeed it would be interesting to measure.