Class for a Heap datastructure.
| Instance Method Summary | |
clear()Removes all elements from the heap. | |
clone() ⇒ ?goog.structs.HeapClones a heap and returns a new heap | |
containsKey(?Object key) ⇒ booleanWhether the heap contains the given key. | |
containsValue(?Object val) ⇒ booleanWhether the heap contains the given value. | |
getCount() ⇒ numberThe number of key-value pairs in the map | |
getKeys() ⇒ ?ArrayGets the keys of the heap. | |
getLeftChildIndex_(number index) ⇒ numberGets the index of the left child of the node at the given index. | |
getParentIndex_(number index) ⇒ numberGets the index of the parent of the node at the given index. | |
getRightChildIndex_(number index) ⇒ numberGets the index of the right child of the node at the given index. | |
getValues() ⇒ ?ArrayGets the values of the heap. | |
insert(<Any Type> key, <Any Type> value)Insert the given value into the heap with the given key. | |
insertAll((Object|goog.structs.Heap|null) heap)Adds multiple key-value pairs from another goog.structs.Heap or Object | |
isEmpty() ⇒ booleanReturns true if this heap contains no elements. | |
moveDown_(number index)Moves the node at the given index down to its proper place in the heap. | |
moveUp_(number index)Moves the node at the given index up to its proper place in the heap. | |
peek() ⇒ <Any Type>Retrieves but does not remove the root value of this heap. | |
peekKey() ⇒ <Any Type>Retrieves but does not remove the key of the root node of this heap. | |
remove() ⇒ <Any Type>Retrieves and removes the root value of this heap. | |