[protected]
Recursive function building the tree.
The depth parameter starts at maxDepth and is decreased until it reaches 0, where the is terminated.