System Namespace Array Class
Sorts the elements in a section of a one-dimensional Array using the IComparable interface implemented by each element of the Array.
[ VB ]
<Serializable>
Overloads Public
Shared Sub Sort ( _
ByVal array As Array, _
ByVal index As Integer, _
ByVal length As Integer _
)
[ C# ]
[Serializable]
public static void Sort (
Array array,
int index,
int length
);
[ C++ ]
[Serializable]
public: static void Sort (
Array* array,
int index,
int length
);
[JScript ]
public Serializable
static function Sort (
array : Array,
index : int,
length : int
);
- array
- The one-dimensional Array to sort.
- index
- The starting index of the range to sort.
- length
- The number of elements in the range to sort.
Each element within the specified section of array must implement the IComparable interface to be capable of comparisons with every other element in array.
If the sort is not successfully completed, the results are undefined.
This method uses the QuickSort algorithm. This is an O ( n log2n ) operation, where n is the number of elements to sort.
Array Members Array.Sort Overload List IComparable BinarySearch