Page 1 of 1

Which of the following functions returns the sum of leaves of given tree? O int sumleaves (tree_node* r) { if (r-=NULL)

Posted: Sat May 14, 2022 4:57 pm
by answerhappygod
Which Of The Following Functions Returns The Sum Of Leaves Of Given Tree O Int Sumleaves Tree Node R If R Null 1
Which Of The Following Functions Returns The Sum Of Leaves Of Given Tree O Int Sumleaves Tree Node R If R Null 1 (72.48 KiB) Viewed 32 times
Which of the following functions returns the sum of leaves of given tree? O int sumleaves (tree_node* r) { if (r-=NULL) return 0; if (r->left == NULL && r->right==NULL) return r->val; return sumleaves (r->left) + sumleaves (r->right); O int gumleaves (tree node* 1) { if (r==NULL) return 0; if (r->left NULL && r->right==NULL) return r->val; return sumleaves (r->left) + gumleaves (r->right) + r->val; } O int sumleaves (tree node* r) { if (r->left NULL && r->right==NULL) return r->val; return sumleaves (r->left) + gumleaves (r->right) + r->val; O int sumleaves (tree node* r) { if (x==NULL) return 0; if (r->left == NULL && r->right==NULL) return r->val; 1