int func(Node root) { if(root == NULL) return 0; else if(root->left == NULL && root->right == NULL) return 2; else return(3 + func(root->left) + func(root->right)); }
Above code is executed on the following rooted tree.
What will be the output?
32 [each leaf node return 2]
64.3k questions
77.9k answers
244k comments
80.0k users