|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.util.QuickSort
public class QuickSort
This class performs Quick Sort algorithm for an array or a List
of objects.
This class differs from sorting algorithms provided by the Arrays
and the Collections
classes:
Note: because this class does not allocate any temporary arrays, it uses indexed access
to the specified List
. Therefore it is important that specified List
has
efficient implementations of indexed 'get' and 'set' operations.
Method Summary | |
---|---|
static void |
sort(List list)
Sorts the specified list in ascending order according to the natural ordering of its elements. |
static void |
sort(List list,
Comparator c)
Sorts the specified list according to the order induced by the specified comparator. |
static void |
sort(List list,
int from_index,
int to_index)
Sorts the specified range of the specified list in ascending order according to the natural ordering of its elements. |
static void |
sort(List list,
int from_index,
int to_index,
Comparator c)
Sorts the specified range of the specified list according to the order induced by the specified comparator. |
static void |
sort(Object[] a)
Sorts the specified array in ascending order according to the natural ordering of its elements. |
static void |
sort(Object[] a,
Comparator c)
Sorts the specified array according to the order induced by the specified comparator. |
static void |
sort(Object[] a,
int from_index,
int to_index)
Sorts the specified range of the specified array in ascending order according to the natural ordering of its elements. |
static void |
sort(Object[] a,
int from_index,
int to_index,
Comparator c)
Sorts the specified range of the specified array according to the order induced by the specified comparator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void sort(Object[] a)
a
- the array to be sorted.public static void sort(Object[] a, Comparator c)
a
- the array to be sorted.c
- the comparator to determine the order of the array. The 'null' value indicates 'natural ordering'.public static void sort(Object[] a, int from_index, int to_index)
a
- the array to be sorted.from_index
- the index of the first element (inclusive) to be sorted.to_index
- the index of the last element (exclusive) to be sorted.public static void sort(Object[] a, int from_index, int to_index, Comparator c)
a
- the array to be sorted.from_index
- the index of the first element (inclusive) to be sorted.to_index
- the index of the last element (exclusive) to be sorted.c
- the comparator to determine the order of the array. The 'null' value indicates 'natural ordering'.public static void sort(List list)
list
- the list to be sorted.public static void sort(List list, Comparator c)
list
- the list to be sorted.c
- the comparator to determine the order of the list. The 'null' value indicates 'natural ordering'.public static void sort(List list, int from_index, int to_index)
list
- the list to be sorted.from_index
- the index of the first element (inclusive) to be sorted.to_index
- the index of the last element (exclusive) to be sorted.public static void sort(List list, int from_index, int to_index, Comparator c)
list
- the list to be sorted.from_index
- the index of the first element (inclusive) to be sorted.to_index
- the index of the last element (exclusive) to be sorted.c
- the comparator to determine the order of the array. The 'null' value indicates 'natural ordering'.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |