Class BinaryTree
java.lang.Object
BinaryTree
- Direct Known Subclasses:
- MutableBinaryTree
public class BinaryTree
- extends java.lang.Object
BinaryTree class done by the professor.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
root
protected java.lang.Comparable root
left
protected BinaryTree left
right
protected BinaryTree right
NIL
public static final BinaryTree NIL
BinaryTree
protected BinaryTree()
BinaryTree
public BinaryTree(java.lang.Comparable d)
BinaryTree
public BinaryTree(java.lang.Comparable d,
BinaryTree left,
BinaryTree right)
nil
public BinaryTree nil()
root
public java.lang.Comparable root()
left
public BinaryTree left()
right
public BinaryTree right()
setData
public void setData(java.lang.Comparable d)
setLeft
public void setLeft(BinaryTree t)
setRight
public void setRight(BinaryTree t)
isEmpty
public boolean isEmpty()
insert
public BinaryTree insert(BinaryTree newNode)
insertDestructive
public BinaryTree insertDestructive(BinaryTree newNode)
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
toString
public java.lang.String toString(java.lang.String order)
parseBinaryTreeInts
public static BinaryTree parseBinaryTreeInts(java.lang.String s)