Question: Create a method called depth that will return an int representing the level or depth of the given node from the root.
Create a method called depth that will return an int representing the level or depth of the given node from the root.
Step by Step Solution
3.41 Rating (170 Votes )
There are 3 Steps involved in it
The depth of a node in a binary tree is the total number of edges from the root node to the target ... View full answer
Get step-by-step solutions from verified subject matter experts
