Class Sort
Encapsulates useful sorting utilities.
Inheritance
System.Object
Sort
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class Sort
Methods
QuickSort<T>(List<T>, Function2<T, T, CompareResult>)
Sorts an array using the in-place quick-sort algorithm.
Declaration
public static void QuickSort<T>(List<T> array, Function2<T, T, CompareResult> comparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | array | The array of elements. |
Function2<T, T, CompareResult> | comparer | The function used to compare elements in the array - should return less than 0 if item 1 is less than item 2 (item 1 should appear before item 2), 0 if the items are equal, or more than 0 is item 1 is greater than item 2 (item 1 should appear after item 2). |
Type Parameters
Name | Description |
---|---|
T | The type of elements in the array. |