public TreeIterator(BinaryTree <T> theTree)
 {
     t       = theTree;
     current = null;
 }
 public void setLeft(BinaryNode <T> node)
 {
     _left = node;
 }
 public void setRight(BinaryNode <T> node)
 {
     _right = node;
 }
Пример #4
0
 public void makeEmpty()
 {
     Root = null;
 }
 public BinaryNode(T element, BinaryNode <T> lt, BinaryNode <T> rt)
 {
     _element = element;
     _left    = lt;
     _right   = rt;
 }
Пример #6
0
 public int size()
 {
     return(BinaryNode <T> .size(Root));
 }
Пример #7
0
 public int height()
 {
     return(BinaryNode <T> .height(Root));
 }
Пример #8
0
 public BinaryTree(T rootItem)
 {
     Root = new BinaryNode <T>(rootItem);
 }
Пример #9
0
 public BinaryTree()
 {
     Root = null;
 }
Пример #10
0
 public void RemoveMin()
 {
     Root = RemoveMin(Root);
 }
Пример #11
0
 public void Remove(T x)
 {
     Root = Remove(x, Root);
 }
Пример #12
0
 public void Insert(T x)
 {
     Root = Insert(x, Root);
 }