public abstract class IntroSorter extends Sorter
Sorterimplementation based on a variant of the quicksort algorithm called introsort: when the recursion level exceeds the log of the length of the array to sort, it falls back to heapsort. This prevents quicksort from running into its worst-case quadratic runtime. Small arrays are sorted with insertion sort.
|Constructor and Description|
Create a new
|Modifier and Type||Method and Description|
Compare the pivot with the slot at
Save the value at slot
Sort the slice which starts at
public final void sort(int from, int to)
from(inclusive) and ends at
protected abstract void setPivot(int i)
iso that it can later be used as a pivot, see
protected abstract int comparePivot(int j)
j, similarly to
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.