Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 (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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started