function countNodes(root) { function dfs(node) { if(node === null) return 0; return dfs(node.left) + dfs(node.right) + 1; } dfs(root);}