Interface for collecting information about the elements stored in the heap
Remove the minimum element from this heap, or raise an exception iff this
heap is empty (isEmpty()==true
)
Remove the minimum element from this heap, or raise an exception iff this
heap is empty (isEmpty()==true
)
a heap that contains all elements of this heap except for the minimum element
Construct an empty heap
Construct an empty heap
the minimum element of this heap, or raise an exception iff this
heap is empty (isEmpty()==true
)
Apply a function f
to all elements in this heap.
Apply a function f
to all elements in this heap. The heap
traversal is skipped for a subheap if the function stop
applied to this subheap returns true
. The function
f
can return null
to signal that a data
element has not changed.
Add an element to this heap object
Add an element to this heap object
The element to be added
a heap that contains all elements of this heap, and
additionally element
Add multiple elements to this heap object.
Add multiple elements to this heap object. We keep this method protected, because otherwise one could use it to insert heaps that are sorted differently
a heap containing the elements to be added
a heap that contains all elements of this heap, and
additionally all objects from h
Remove all elements of this heap which are equal
to element
.
Remove all elements of this heap which are equal
to element
.
heap that has all occurrences of element
removed
Length of the right spine, i.e.
Length of the right spine, i.e. the length of the path from the root to rightmost leaf
the minimum element of this heap, or None> iff this
heap is empty (
isEmpty()==true
)
Apply a function f
to all elements in this heap.
Apply a function f
to all elements in this heap. The heap
traversal is skipped for a subheap if the function stop
applied to this subheap returns true
. The function
f
can return null
to signal that a data
element has not changed.
Apply a function f
to all elements in this heap.
Apply a function f
to all elements in this heap. The heap
traversal is skipped for a subheap if the function stop
applied to this subheap returns true
. The function
f
can return null
to signal that a data
element has not changed.
Add multiple elements to this heap object
Add multiple elements to this heap object
the elements to be added
a heap that contains all elements of this heap, and
additionally all objects from elements
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
an iterator that returns all elements of this heap in increasing order
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
an iterator that returns all elements of this heap
(Since version ) see corresponding Javadoc for more information.
This class implements the leftist heap, see "Functional Data Structures" by Chris Okasaki