MaxHeap {Containers}R Documentation

Constructor for Class MaxHeap

Description

This method instanciates class MaxHeap.

Usage

aHeap = MaxHeap()

Author(s)

John Hughes

Examples

aHeap = MaxHeap()     # Instanciate a MaxHeap.
aHeap$insert(5)       # Insert a few elements.
aHeap$insert(3)
aHeap$insert(4)
aHeap$insert(1)
aHeap$insert(6)
aHeap$peekMax()       # Inspect the maximum element.
aHeap$removeMax()     # Remove the maximum element.
aHeap$peekMax()       # Inspect the new maximum.

[Package Containers version 1.2 Index]