Untitled
unknown
plain_text
4 years ago
236 B
8
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);
}Editor is loading...