public class Select
extends java.lang.Object
The lowest ranking element starts at 1, not 0. 1 = first, 2 = second, 3 = third, etc. calling with a value of zero will result
in a GdxRuntimeException
This class uses very minimal extra memory, as it makes no copies of the array. The underlying algorithms used are a naive single-pass for k=min and k=max, and Hoare's quickselect for values in between.
构造器和说明 |
---|
Select() |
限定符和类型 | 方法和说明 |
---|---|
static Select |
instance()
Provided for convenience
|
<T> T |
select(T[] items,
java.util.Comparator<T> comp,
int kthLowest,
int size) |
<T> int |
selectIndex(T[] items,
java.util.Comparator<T> comp,
int kthLowest,
int size) |
public static Select instance()
public <T> T select(T[] items, java.util.Comparator<T> comp, int kthLowest, int size)
public <T> int selectIndex(T[] items, java.util.Comparator<T> comp, int kthLowest, int size)