Question: JAVA 14. Using the BTNode class from Chapter 9, write a new static method of the BTNode class to meet the following specification. public static
JAVA
14. Using the BTNode class from Chapter 9, write a new static method of the BTNode class to meet the following specification. public static int treeDepth(BTNode root) // Precondition: root_ptr is the root reference of a binary tree. // Postcondition: The return value is the depth of the binary tree. // NOTES: The empty tree has a depth of -1 and a tree with just a root // has a depth of 0.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
