org.apache.hadoop.util
Class QuickSort
java.lang.Object
org.apache.hadoop.util.QuickSort
- All Implemented Interfaces:
- IndexedSorter
public class QuickSort
- extends Object
- implements IndexedSorter
An implementation of the core algorithm of QuickSort.
See "Median-of-Three Partitioning" in Sedgewick book.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QuickSort
public QuickSort()
sort
public void sort(IndexedSortable s,
int p,
int r)
- Description copied from interface:
IndexedSorter
- Sort the items accessed through the given IndexedSortable over the given
range of logical indices. From the perspective of the sort algorithm,
each index between l (inclusive) and r (exclusive) is an addressable
entry.
- Specified by:
sort
in interface IndexedSorter
- See Also:
IndexedSortable.compare(int, int)
,
IndexedSortable.swap(int, int)
sort
public void sort(IndexedSortable s,
int p,
int r,
Progressable rep)
- Same as
sort(org.apache.hadoop.util.IndexedSortable, int, int)
, but indicate that we're making progress after
each partition.
Copyright © 2006 The Apache Software Foundation