Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int depth() {
- if (left == null && right == null)
- return 0;
- else if (left != null && right != null)
- return 1 + Math.max(left.depth(), right.depth());
- else if (left == null)
- return 1 + right.depth();
- else
- return 1 + left.depth();
- }
Add Comment
Please, Sign In to add comment