Question: Write a method that returns the height of the binary tree when called on the node at the root of the tree. A single node
Write a method that returns the height of the binary tree when called on the node at the root of the tree. A single node tree should return one.
fill in the code accordingly(java)
public class Node
E data;
Node
Node
public int getHeight() {
return 0;
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
