Class MutableBinaryTree
java.lang.Object
BinaryTree
MutableBinaryTree
public final class MutableBinaryTree
- extends BinaryTree
MutableBinaryTree class that extends BinaryTree to make the toString methods reusable and to make a parse method
to make a mutableBinaryTree out of a mutable binary tree in form of a string.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NIL
public static final MutableBinaryTree NIL
MutableBinaryTree
public MutableBinaryTree()
MutableBinaryTree
public MutableBinaryTree(java.lang.Comparable d)
MutableBinaryTree
public MutableBinaryTree(java.lang.Comparable d,
MutableBinaryTree left,
MutableBinaryTree right)
left
public MutableBinaryTree left()
- Overrides:
left in class BinaryTree
right
public MutableBinaryTree right()
- Overrides:
right in class BinaryTree
isEmpty
public boolean isEmpty()
- Overrides:
isEmpty in class BinaryTree
toString
public java.lang.String toString()
- Overrides:
toString in class BinaryTree
parseMutableBinaryTreeString
public static MutableBinaryTree parseMutableBinaryTreeString(java.lang.String input)
- Public method to convert a string to a mutable binary tree
- Parameters:
input - the mutable binary tree in form of a string
- Returns: