Untitled
Anonymous
plain_text
01/10/2022 7:45 AM
316 B
14
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...