|
static unsafe void | QuickSelect< T, U > (ref NativeList< T > list, U comparer, int k) |
| Finds the kth smallest element in a list in O(n) - smallest being defined by a comparer (i.e. you can also use it to find the kth largest element) The list is changed during this process, such that the kth smallest element is at position k of the list, and all smaller elements are to the left, and all larger element are to the right of k.
|
|
static unsafe void | QuickSelect< T, U > (ref NativeList< T > list, U comparer, int k, int left, int right) |
| Finds the kth smallest element in a subset of a list in O(n) in the range [left, right) - smallest being defined by a comparer (i.e. you can also use it to find the kth largest element) The list is changed during this process, such that the kth smallest element is at position k + left of the list, and all smaller elements are to the left, and all larger element are to the right of k in the interval [left, right).
|
|
static unsafe void QuickSelect< T, U > |
( |
ref NativeList< T > | list, |
|
|
U | comparer, |
|
|
int | k, |
|
|
int | left, |
|
|
int | right ) |
|
static |
Finds the kth smallest element in a subset of a list in O(n) in the range [left, right) - smallest being defined by a comparer (i.e. you can also use it to find the kth largest element) The list is changed during this process, such that the kth smallest element is at position k + left of the list, and all smaller elements are to the left, and all larger element are to the right of k in the interval [left, right).
- Template Parameters
-
- Parameters
-
list | |
comparer | |
k | |
left | |
right | |
- Type Constraints
-
T | : | unmanaged | |
U | : | unmanaged | |
U | : | IComparer<T> | |