goog.structs.Heap | |
goog.structs.PriorityQueue | goog.structs.Heap |
![]()
Retrieves and removes the head of this queue.
Returns: VALUE
The element at the head of this queue. Returns undefined if
the queue is empty.
|
code » | |||
![]()
Puts the specified value in the queue.
Arguments:
|
code » |
![]()
Removes all elements from the heap.
|
code » | |||
Clones a heap and returns a new heap
Returns: !goog.structs.Heap
A new goog.structs.Heap with the same key-value
pairs.
|
code » | |||
Whether the heap contains the given key.
Arguments:
Returns: boolean
Whether the heap contains the key.
|
code » | |||
Whether the heap contains the given value.
Arguments:
Returns: boolean
Whether the heap contains the value.
|
code » | |||
The number of key-value pairs in the map
Returns: number
The number of pairs.
|
code » | |||
Gets the keys of the heap.
|
code » | |||
Gets the index of the left child of the node at the given index.
|
code » | |||
Gets the index of the parent of the node at the given index.
|
code » | |||
Gets the index of the right child of the node at the given index.
|
code » | |||
Gets the values of the heap.
|
code » | |||
![]()
Insert the given value into the heap with the given key.
Arguments:
|
code » | |||
![]()
Adds multiple key-value pairs from another goog.structs.Heap or Object
Arguments:
|
code » | |||
Returns true if this heap contains no elements.
Returns: boolean
Whether this heap contains no elements.
|
code » | |||
![]()
Moves the node at the given index down to its proper place in the heap.
Arguments:
|
code » | |||
![]()
Moves the node at the given index up to its proper place in the heap.
Arguments:
|
code » | |||
![]()
Retrieves but does not remove the root value of this heap.
Returns: V
The value at the root of the heap. Returns
undefined if the heap is empty.
|
code » | |||
![]()
Retrieves but does not remove the key of the root node of this heap.
Returns: V
The key at the root of the heap. Returns undefined if the
heap is empty.
|
code » | |||
![]()
Retrieves and removes the root value of this heap.
Returns: V
The value removed from the root of the heap. Returns
undefined if the heap is empty.
|
code » |
![]()
No description.
|
Code » |
![]()
The nodes of the heap.
|
Code » |
![]()
No description.
|
Code » |