|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.inria.opengve.tools.dataStructures.BinaryTree<E,V>
E
- The type of element stored in the tree.V
- The value associated with each element.public class BinaryTree<E,V extends java.lang.Comparable<V>>
Basic implementation of binary tree. You must note that this implementation doesn't balance tree.
Constructor Summary | |
---|---|
BinaryTree()
Create a new empty tree. |
Method Summary | |
---|---|
void |
clear()
Make the priority queue logically empty. |
boolean |
contains(E element)
Say if the priority queue contains a given elemeent. |
E |
deleteMin()
Remove the smallest item from the priority queue. |
E |
find(V k)
Return object associated with a specific value. |
E |
findMin()
Find the smallest item in the priority queue. |
V |
getValueOf(E element)
Give the value of a given element. |
void |
insert(E x,
V value)
Insert into the priority queue. |
boolean |
isEmpty()
Test if the priority queue is logically empty. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryTree()
Method Detail |
---|
public void clear()
clear
in interface PriorityQueue<E,V extends java.lang.Comparable<V>>
public E deleteMin() throws java.util.NoSuchElementException
deleteMin
in interface PriorityQueue<E,V extends java.lang.Comparable<V>>
java.util.NoSuchElementException
- if the priority queue is empty.public E findMin() throws java.util.NoSuchElementException
findMin
in interface PriorityQueue<E,V extends java.lang.Comparable<V>>
java.util.NoSuchElementException
- if the priority queue is empty.public boolean isEmpty()
isEmpty
in interface PriorityQueue<E,V extends java.lang.Comparable<V>>
public void insert(E x, V value)
insert
in interface PriorityQueue<E,V extends java.lang.Comparable<V>>
x
- The object to insert.value
- The value of the object.public E find(V k) throws java.util.NoSuchElementException
k
- The value.
java.util.NoSuchElementException
- if the value k is not present in the tree.public boolean contains(E element)
contains
in interface PriorityQueue<E,V extends java.lang.Comparable<V>>
element
- The element.
true
if the element belong to the priority queue and
false
otherwise.public V getValueOf(E element)
getValueOf
in interface PriorityQueue<E,V extends java.lang.Comparable<V>>
element
- The element.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |