Consider the following function foobar(),
which takes binary tree as input.
int foobar(struct node *root){
if(!root) return 0;
if((!root->left)&&(!root->right)) return 10;
else{
int i=foobar(root->left);
int j=foobar(root->right);
return i+j;
}
}
What does the above function foobar()
compute?
$A)$ Sum of internal node of binary tree.
$B)$ Number of leaves in binary tree
$C)$ Sum of leaves node of binary tree.
$D)$ None
What return $10$ actually means?