apollo.util.interval
Class RbTree
java.lang.Object
apollo.util.interval.RbTree
public class RbTree
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RbTree
public RbTree(StatisticUpdate updater)
RbTree
public RbTree()
insert
public void insert(RbNode x)
get
public RbNode get(int key)
root
public RbNode root()
minimum
public RbNode minimum(RbNode node)
maximum
public RbNode maximum(RbNode node)
successor
public RbNode successor(RbNode x)
predecessor
public RbNode predecessor(RbNode x)
size
public int size()
- Returns the number of nodes in the tree.
isValid
public boolean isValid()
- Test code: make sure that the tree has all the properties
defined by Red Black trees:
o. Root is black.
o. NIL is black.
o. Red nodes have black children.
o. Every path from root to leaves contains the same number of
black nodes.
Calling this function will be expensive, as is meant for
assertion or test code.