-
A standard binary tree algorithm is to count the number of nodes in the tree. Here is a pseudocode version.
- Count the left subtree recursively
- Count the current node as one
- Count the right subtree recursively
As you develop the code, consider what base case will terminate the recursion.