I know how to find the size of a tree with recursion, but I am unsure on how to find it without recursion. Here is what i have so far. I think that it is my if statement that is preventing me from transversing the tree.
public int size() {
size = 0;
NodeWord current = root;
while(current != null) {
if(current.left != null) {
size++;
}
else {
current = current.right;
}
}
return size;
}