HeapSift2D (Function)
The HeapSift2D performs a "heap sort" on a town dimensional array as part of the SortHeap2DArray function.
Syntax
HeapSift2D(MyArray, ColIndx3, Size1, Size2, Order)
Returns (Boolean)
The order of values of the array specified in MyArray are changed as the result of running HeapSift2D. The HeapSift2D function itself returns True.
Parameters
|
Name |
Type |
Description |
|
MyArray |
Numeric Array |
Specifies the name of a numeric array containing values upon which the sort is performed. |
|
ColIndx3 |
Numeric |
Sets starting column in the array. |
|
Size1 |
Numeric |
Sets the row of the array to evaluate. |
|
Size2 |
Numeric |
Sets number of columns in the array to sort, starting with ColIndx. |
|
Order |
Numeric |
Sets the sort order. 1 = sort descending, -1 = sort ascending |
Remarks
A "heap sort" may be better suited for sorting arrays of more than 25 elements compared to a simple sort (that may be faster for arrays of 25 or fewer elements).
The value for the Size input parameter should always be a whole number greater than 0 and is typically equal to the number of data elements in the array.
The HeapSift2D function only works with two-dimensional arrays. All array-based referencing begins with array element 1.