int countNodes(TreeNode* temp) {
if(temp==NULL)
return 0;
if(temp->right!=NULL)
return 1+countNodes(temp->right);
if(temp->left!=NULL)
return 1+countNodes(temp->left);
return 0;
}
i wrote this function to find to count no of node in tree
but im getting different expected output.