Take out a piece of paper and put your name on the upper right corner.
public class BinaryTree<E> {
private BinaryNode<E> root;
public String toString() {
// your code
}
private class BinaryNode<E> {
private E data;
private BinaryNode<E> left;
private BinaryNode<E> right;
}
}
You can use a helper method.
Be sure to write JavaDoc comments for your code.
What is the BigO for the toString() method?
Bonus point: implement the LinkedList’s E get(int index) method.
Hand in your code when you are done.
Take a short break and be back in your seats at
Time remaining: