https://leetcode.com/problems/count-complete-tree-nodes


Runtime: 0 ms, faster than 100.00% of Java online submissions for Count Complete Tree Nodes.
Memory Usage: 41.5 MB, less than 49.62% of Java online submissions for Count Complete Tree Nodes.


```java
class Solution {
    private int counting;
    
    private void travel(TreeNode node) {
        if (node != null) {
            counting += 1;
            travel(node.left);
            travel(node.right);
        }
    }
    
    public int countNodes(TreeNode root) {
        //4:26
        counting = 0;
        travel(root);
        return counting;
        //4:27
    }
}
```