|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.util.ArraySort
public class ArraySort
Support class for sorting arrays of integers and doubles. The code for quicksort was based on information provided in the wikipedia entry for quicksort.
Constructor Summary | |
---|---|
ArraySort()
|
Method Summary | |
---|---|
static void |
bubbleSort(int[] keys)
Performs a bubble sort on an array of integers into ascending order. |
static void |
bubbleSort(int[] keys,
double[] vals)
Performs a bubble sort on an array of integers into ascending order, and correspondingly rearranges an accompanying array of values. |
static void |
bubbleSort(int[] keys,
double[] vals,
int left,
int right)
Performs a bubble sort on a subregion of an array of integers into ascending order, and correspondingly rearranges the same subregion of an accompanying array of values. |
static void |
bubbleSort(int[] keys,
int left,
int right)
Performs a bubble sort on a subregion of an array of integers into ascending order. |
static void |
quickSort(double[] vals)
Performs a quicksort on an array of doubles into ascending order. |
static void |
quickSort(double[] vals,
int[] keys)
Performs a quicksort on an array of doubles into ascending order, and correspondingly rearranges an accompanying array of integer keys. |
static void |
quickSort(double[] vals,
int[] keys,
int left,
int right)
Performs a quicksort on a subregion of an array of doubles into ascending order, and correspondingly rearranges the same subregion of an accompanying array of keys. |
static void |
quickSort(double[] vals,
int left,
int right)
Performs a quicksort on a subregion of an array of doubles into ascending order. |
static void |
quickSort(int[] keys)
Performs a quicksort on an array of integers into ascending order. |
static void |
quickSort(int[] keys,
double[] vals)
Performs a quicksort on an array of integers, into ascending order, and correspondingly rearranges an accompanying array of values. |
static void |
quickSort(int[] keys,
double[] vals,
int left,
int right)
Performs a quicksort on a subregion of an array of integers into ascending order, and correspondingly rearranges the same subregion of an accompanying array of values. |
static void |
quickSort(int[] keys,
int left,
int right)
Performs a quicksort on a subregion of an array of integers into ascending order. |
static void |
sort(int[] keys)
Sorts an array of integers into ascending order. |
static void |
sort(int[] keys,
double[] vals)
Sorts an array of integers into ascending order, and correspondingly rearranges an accompanying array of values. |
static void |
sort(int[] keys,
double[] vals,
int left,
int right)
Sorts a subregion of an array of integers into ascending order, and correspondingly rearranges the same subregion of an accompanying array of values. |
static void |
sort(int[] keys,
int left,
int right)
Sorts a subregion of an array of integers into ascending order. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArraySort()
Method Detail |
---|
public static void sort(int[] keys)
keys
- integers to sortpublic static void sort(int[] keys, int left, int right)
keys
- integers containing the subregion to sortleft
- lower inclusive bound of the subregionright
- upper inclusive bound of the subregionpublic static void sort(int[] keys, double[] vals)
keys
- integers to sortvals
- accompanying values to be sorted into the same order as keys.
Must have a length at least as long as keys.public static void sort(int[] keys, double[] vals, int left, int right)
keys
- integers containing the subregion to sortvals
- accompanying values, whose equivalent subregion is sorted
into the same order as the subregion as keys. Must be long enough
to encompass the subregion.left
- lower inclusive bound of the subregionright
- upper inclusive bound of the subregionpublic static void bubbleSort(int[] keys)
keys
- integers to sortpublic static void bubbleSort(int[] keys, int left, int right)
keys
- integers containing the subregion to sortleft
- lower inclusive bound of the subregionright
- upper inclusive bound of the subregionpublic static void bubbleSort(int[] keys, double[] vals)
keys
- integers to sortvals
- accompanying values to be sorted into the same order as keys.
Must have a length at least as long as keys.public static void bubbleSort(int[] keys, double[] vals, int left, int right)
keys
- integers containing the subregion to sortvals
- accompanying values, whose equivalent subregion is sorted
into the same order as the subregion as keys. Must be long enough
to encompass the subregion.left
- lower inclusive bound of the subregionright
- upper inclusive bound of the subregionpublic static void quickSort(int[] keys, int left, int right)
keys
- integers containing the subregion to sortleft
- lower inclusive bound of the subregionright
- upper inclusive bound of the subregionpublic static void quickSort(int[] keys)
keys
- integers to sortpublic static void quickSort(int[] keys, double[] vals, int left, int right)
keys
- integers containing the subregion to sortvals
- accompanying values, whose equivalent subregion is sorted
into the same order as the subregion as keys. Must be long enough
to encompass the subregion.left
- lower inclusive bound of the subregionright
- upper inclusive bound of the subregionpublic static void quickSort(int[] keys, double[] vals)
keys
- integers to sortvals
- accompanying values to be sorted into the same order as keys.
Must have a length at least as long as keys.public static void quickSort(double[] vals, int left, int right)
vals
- doubles containing the subregion to sortleft
- lower inclusive bound of the subregionright
- upper inclusive bound of the subregionpublic static void quickSort(double[] vals)
vals
- values to sortpublic static void quickSort(double[] vals, int[] keys, int left, int right)
vals
- array of values containing the subregion to sortkeys
- accompanying keys, whose equivalent subregion is sorted
into the same order as the subregion of vals. Must be long enough
to encompass the subregion.left
- lower inclusive bound of the subregionright
- upper inclusive bound of the subregionpublic static void quickSort(double[] vals, int[] keys)
vals
- values to sortkeys
- accompanying keys to be sorted into the same order as vals.
Must have a length at least as long as vals.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |