Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int countEmpty() {
- return treeCrawler(overallRoot);
- }
- int count = 1;
- private int treeCrawler(IntTreeNode root) {
- if (root == null) {
- return count;
- } else {
- treeCrawler(root.right);
- count++;
- treeCrawler(root.left);
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement