New Heap (gb.data)
Creates a new Heap.
If
Mode is gb.Ascent, it's a MinHeap, i.e. the smallest element is at
the beginning. If
Mode is gb.Descent, it's a MaxHeap.
If the
Array argument is given, a copy of that array is transformed
into a Heap, by using a bottom-up algorithm which is O(n).