goog.structs.Heap
Classgoog.structs.Heap(opt_heap)
Class for a Heap datastructure.
opt_heap
{goog.structs.Heap
|Object
=}
.clear()
Removes all elements from the heap.
.clone()
Clones a heap and returns a new heap
goog.structs.Heap
}
.containsKey(key)
Whether the heap contains the given key.
key
{Object
}
boolean
}
.containsValue(val)
Whether the heap contains the given value.
val
{Object
}
boolean
}
.getCount()
The number of key-value pairs in the map
number
}
.getKeys()
Gets the keys of the heap.
Array
}
.getValues()
Gets the values of the heap.
Array
}
.insert(key, value)
Insert the given value into the heap with the given key.
key
{*}
value
{*}
.insertAll(heap)
Adds multiple key-value pairs from another goog.structs.Heap or Object
heap
{goog.structs.Heap
|Object
}
.isEmpty()
Returns true if this heap contains no elements.
boolean
}
.peek()
Retrieves but does not remove the root value of this heap.
.peekKey()
Retrieves but does not remove the key of the root node of this heap.
.remove()
Retrieves and removes the root value of this heap.