|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.data.QuickSort
public class QuickSort
A generic quicksort. Based on chapter 9 of Algorithms, by Robert Sedgewick,
1988 ISBN 0-201-06673-4. Uses pluggable SortingGophers to allow
sorting of any list of data.
This isn't declared as a singleton, since it has no actual overhead (no
state), so there's not strong reason to limit instantiation. However an
standardInstance() method is provided that provides a shared
instance.
You can also just use this via the handy convenience method
SortingLib.quickSort(SortingGopher); that is actually the
recommended method.
Copyright 2000-2006 Partner Software, Inc.
| Constructor Summary | |
|---|---|
QuickSort()
Creates a new QuickSort algorithm object. |
|
| Method Summary | |
|---|---|
void |
sort(SortingGopher gopher)
Sorts using the given SortingGopher. |
void |
sort(SortingGopher gopher,
int start,
int end)
Sorts using the given SortingGopher over the given range (start <=
i < end). |
static QuickSort |
standardInstance()
Returns a singleton shared instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QuickSort()
standardInstance() method.
| Method Detail |
|---|
public static QuickSort standardInstance()
public void sort(SortingGopher gopher)
SortingAlgorithmSortingGopher.
sort in interface SortingAlgorithmgopher - SortingGopher adapter for underlying array-like structure.
public void sort(SortingGopher gopher,
int start,
int end)
SortingAlgorithmSortingGopher over the given range (start <=
i < end).
sort in interface SortingAlgorithmgopher - SortingGopher adapter for underlying array-like structure.start - starting index (0 is minimum) for sort region (inclusive)end - ending index for sort region (exclusive)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||