Lazarus Wald wrote:I also do not understand the data type "Node<E>", does it has anything to do with iterables in java?
Junilu Lacar wrote: This is what allows you to "walk down the tree" and each level you step down into (recurse into), you add 1 to the height of the tree, hence the expressions leftheight = getHeight(...) + 1; and rightheight = getHeight(...) + 1.
As Carey said, you're close. You're just missing the reference to the node you want to treat as the root node for the current recursion level.
Lazarus Wald wrote:Les Morgan, thanks for your great input. I believe that I understand the idea of a halting condition, but the only that can come to mind in this case is: if (leftChild==null && rightChild==null). I am assuming that leftChild references the current left node and rightChild references the current right node.
Campbell Ritchie wrote:I had had to learn that this is up ↓ and this is down ↑.
up = ← down = →
Junilu Lacar wrote:. . . Classic Mac v. Windows wars: which way is scroll up/down?