Click or drag to resize
QuickSelect Method
Rearranges the array so that a[k] contains the kth smallest key; a[0] through a[k-1] are OrderHelper.Less than (or equal to) a[k]; and a[k+1] through a[N-1] are greater than (or equal to) a[k].

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static IComparable Select(
	IComparable[] a,
	int k
)

Parameters

a
Type: SystemIComparable
a the array
k
Type: SystemInt32
k find the kth smallest

Return Value

Type: IComparable
the rearranged array
Exceptions
ExceptionCondition
IndexOutOfRangeException if k is out of range
See Also