Untitled

 avatar
unknown
plain_text
3 years ago
236 B
2
Indexable
int countLeafNode(struct node *root){
    
    if(root == NULL)
        return 0;
    
    if(root->left == NULL && root->right == NULL)
        return 1;
   
    return countLeafNode(root->left) + countLeafNode(root->right);
}