|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectkthsmallest.ArrayUtils
public class ArrayUtils
This class provides static methods (utilities) for manipulating arrays.
| Constructor Summary | |
|---|---|
ArrayUtils()
|
|
| Method Summary | |
|---|---|
static int |
kSmall(int k,
int[] anArray,
int first,
int last)
Returns the kth-smallest element of the given array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayUtils()
| Method Detail |
|---|
public static int kSmall(int k,
int[] anArray,
int first,
int last)
Effects: Upon return, the given array is partitioned around the kth element: elements to the left are smaller than, and elements to the right are larger than, the kths element, whose index will be k-1.
k - indicates position of desired elementanArray - array of elements to be searchedfirst - first element of anArray to begin searchinglast - last element of anArray to search
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||