public int nrNodes() {
return 0;
}
In the NodeTree class, however, we implement the nrNodes
method recursively as follows:
public int nrNodes() {
return left.nrNodes() + right.nrNodes() + 1;
}
In other words, the number of nodes in a NodeTree is one more
than the sum of the numbers of nodes in its left and right
subtrees.