org.apache.hadoop.util
Class QuickSort

java.lang.Object
  extended by 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.


Constructor Summary
QuickSort()
           
 
Method Summary
 void sort(IndexedSortable s, int p, int r)
          Sort the items accessed through the given IndexedSortable over the given range of logical indices.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickSort

public QuickSort()
Method Detail

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