An ugly but non-intrusive workaround, that would not add much overhead for
usual cases,taking advantage of quadraticness blowing up in stack overflow
before long:
public class ParanoidSort { public static void sort(Object[] a) {
try {
Arrays.sort(a);
} catch (Stac
On 1/27/2015 12:15 PM, Doug Lea wrote:
On 01/27/2015 08:44 AM, Buis, Paul wrote:
The slowdown would be passing a single extra integer parameter,
decrementing it and comparing it to zero at the beginning of the
function.
Right. The question is whether even a small slowdown is warranted.
Does
On 01/27/2015 08:44 AM, Buis, Paul wrote:
The slowdown would be passing a single extra integer parameter, decrementing it
and comparing it to zero at the beginning of the function.
Right. The question is whether even a small slowdown is warranted.
Does quadratic behavior arise more that once
The slowdown would be passing a single extra integer parameter, decrementing it
and comparing it to zero at the beginning of the function.
With an initial value of 4*logN, heapsort would hardly ever be called in
practice, only after a long series of unfortundate pivot choices that indicate
the
On 01/26/2015 03:05 PM, Buis, Paul wrote:
DualPivotQuickSort is used by Arrays.sort() and provides NlogN average
performance, but does not guarantee NlogN worst case performance. It would be
relatively easy to incorporate the basic idea of IntroSort (see
http://en.wikipedia.org/wiki/Introsort) to
Hi.
>It would be relatively easy to incorporate the basic idea of IntroSort (see
>http://en.wikipedia.org/wiki/Introsort)
For the record, I tried (not too hard :) to get it piggy-backed into
DualPivotQuickSort-related modifications,
but without success :
http://mail.openjdk.java.net/pipermail/c
DualPivotQuickSort is used by Arrays.sort() and provides NlogN average
performance, but does not guarantee NlogN worst case performance. It would be
relatively easy to incorporate the basic idea of IntroSort (see
http://en.wikipedia.org/wiki/Introsort) to provide such a guarantee. To make
this