I need to understand the best way to display my linkedBinaryTree. right noe the driver is passing in integers as elements to each node of the tree, For the toString i have tried the following snippet of code but all it returns is for instance is javafoundations.ArrayIterator@ca0b6.
public String toString() {
String thing = "BinaryTreeNode: ";
if (root.getLeft() != null ) {
thing += root.getLeft().toString()+" ";
}
if (root.getRight() != null) {
thing += root.getRight().toString();
}
thing += "}";
return thing;
}