HeapPush (Function)

image\trumpet2.gif Disclaimer

The HeapPush function performs intermediate calculation to determine if heap sifting should continue as part of the SortHeapArray function.

Syntax

HeapPush(MyArray, ColIndx3, Size, Order)

Returns (Boolean)

 The HeapPush function itself returns True if heap sifting should continue.

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 data element in the array.

Size

Numeric

Sets the number of data elements (size) in the array to evaluate for sorting.

Order

Numeric

Sets the sort order.   1 = sort descending,   -1 = sort ascending

Remarks

A "heap sort" may be better suited for sorting of single-dimensional 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 HeapPush function only works with one-dimensional arrays.  All array-based referencing begins with array element 1.