Question: 1. The Node class for a Binary Tree contains, amongst others, the following public func tions: Node getLeftChild; Node getRightChild); int getKeyO (a) Write an

1. The Node class for a Binary Tree contains, amongst others, the following public func tions: Node getLeftChild; Node getRightChild); int getKeyO (a) Write an efficient recursive function int shortestPath (Node n) that returns the number of links on the shortest path from Node n to a leaf Node. (A leaf Node has no children) (b) If this function is passed a reference to the root of an ALV Tree containing 13 nodes, what is the minimum possible value returned by the function? Justify your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
