Click or drag to resize
Accord.NET (logo)

SortPartialT Method (T, Int32, Boolean)

Partially orders a collection, making sure every element smaller than the n-th smaller element are in the beginning of the array.

Namespace:  Accord
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.8.0
Syntax
public static void Partial<T>(
	T[] items,
	int n,
	bool asc = true
)
where T : Object, IComparable<T>
Request Example View Source

Parameters

items
Type: T
The array of elements from which the n-th element should be extracted.
n
Type: SystemInt32
The position to look for (0 returns the smallest element, 1 the second smallest, and so on).
asc (Optional)
Type: SystemBoolean
Whether to take the smallest or the largest element. If set to false, instead of returning the smallest, the method will return the largest elements in the beginning of the array.

Type Parameters

T
The type for the items in the array.
See Also