private static class ImmutableLeftistHeap.Empty<S extends Comparable<S>> extends ImmutableLeftistHeap<S>
| Modifier and Type | Field and Description |
|---|---|
private static ImmutableLeftistHeap<?> |
EMPTY_HEAP
Use this element to construct new heaps
|
private static long |
serialVersionUID |
| Modifier | Constructor and Description |
|---|---|
private |
Empty() |
| Modifier and Type | Method and Description |
|---|---|
ImmutableHeap<S> |
deleteMin()
Remove the minimum element from this heap
|
S |
findMin() |
protected int |
getRightHeight()
Length of the right spine, i.e.
|
ImmutableHeap<S> |
insert(ImmutableHeap<S> h)
Add multiple elements to this heap object
|
ImmutableHeap<S> |
insert(S element)
Add an element to this heap object
|
boolean |
isEmpty() |
ImmutableHeap<S> |
removeAll(S element)
Remove all elements of this heap which are
equal
to element. |
int |
size() |
insert, iterator, nilHeap, sortedIterator, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprivate static final long serialVersionUID
private static final ImmutableLeftistHeap<?> EMPTY_HEAP
protected int getRightHeight()
getRightHeight in class ImmutableLeftistHeap<S extends Comparable<S>>public boolean isEmpty()
public ImmutableHeap<S> insert(S element)
element - The element to be addedelementpublic ImmutableHeap<S> insert(ImmutableHeap<S> h)
h - a heap containing the elements to be addedhpublic S findMin()
isEmpty()==true)public ImmutableHeap<S> deleteMin()
public ImmutableHeap<S> removeAll(S element)
equal
to element.element
removedpublic int size()