SHARE
TWEET

Untitled

a guest Aug 20th, 2019 69 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top