Guest User

Untitled

a guest
Aug 20th, 2019
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int countLeaves(Node* root)
  2. {
  3. if (!root)
  4. return 0;
  5. if (root->right==NULL && root->left==NULL)
  6. {
  7. return 1;
  8. }
  9. return countLeaves(root->left)+countLeaves(root->right);
  10. }
RAW Paste Data