Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(root == null)
- return 0;
- if(root.left != null || root.right != null)
- return 1;
- return nonLeaves(root.left) + nonLeaves(root.right);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement