Question: 3. Write a recursive function evenChildren that takes in a parameter (Node* n). The BST function uses a postorder traversal and returns the number of

 3. Write a recursive function evenChildren that takes in a parameter

3. Write a recursive function evenChildren that takes in a parameter (Node* n). The BST function uses a postorder traversal and returns the number of nodes whose children are both even numbers. A node with only one child doesn't count. Make sure to check for all the edge cases. [20 points) For example, based on the BST on the right evenChildren (root); 14 returns 2 since nodes 7 and 14 have even children 16 8 Use the following tree node struct. struct Node{ int key; Node* left; Node* right; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!