@Deprecated public class TreeHeap<E> extends java.lang.Object implements Heap<E>
SortedSet
.
This implementation will not allow multiple objects which are equal to be added to the heap.
Only use this implementation when object in the heap can be totally ordered (no duplicates).Constructor and Description |
---|
TreeHeap()
Deprecated.
Creates a new tree heap.
|
TreeHeap(int size)
Deprecated.
Creates a new tree heap of the specified size.
|
Modifier and Type | Method and Description |
---|---|
void |
add(E o)
Deprecated.
Adds the specified object to the heap.
|
void |
clear()
Deprecated.
Clears the contents of the heap.
|
E |
extract()
Deprecated.
Removes the smallest element from the heap and returns it.
|
E |
first()
Deprecated.
Returns the smallest element of the heap.
|
boolean |
isEmpty()
Deprecated.
Returns whether the heap is empty.
|
java.util.Iterator<E> |
iterator()
Deprecated.
Returns an iterator over the elements of the heap.
|
E |
last()
Deprecated.
Returns the largest element of the heap.
|
static void |
main(java.lang.String[] args)
Deprecated.
|
int |
size()
Deprecated.
Returns the size of the heap.
|
public TreeHeap()
public TreeHeap(int size)
size
- The size of the new tree heap.public E extract()
Heap
public E first()
Heap
public E last()
Heap
public java.util.Iterator<E> iterator()
Heap
public void add(E o)
Heap
public int size()
Heap
public void clear()
Heap
public boolean isEmpty()
Heap
public static void main(java.lang.String[] args)
Copyright © 2010 - 2020 Adobe. All Rights Reserved