Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
236 B
1
Indexable
Never
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);
}