Solution Review: Tree Depth
Explore how to determine the depth of a tree by recursively traversing its left and right children in Go. Learn to return the maximum depth at each node and understand the time and space complexity of this method.
We'll cover the following...
We'll cover the following...
Solution
We find the depth of a tree by recursively traversing the left and right child of the root. At each level of traversal, we calculate the depth of both left and right children. The greater depth among the left and right children is added ...