Question: 8. Here is a small binary tree: Short Answo Section 10 Tree Traversals 14 2 11 1 3 10 30 7 40 Write the order

 8. Here is a small binary tree: Short Answo Section 10

8. Here is a small binary tree: Short Answo Section 10 Tree Traversals 14 2 11 1 3 10 30 7 40 Write the order of the nodes visited in: A. An in-order traversal: B. A pre-order traversal C. A post-order traversal: 9. Using the binary_tree_node from Section 10.3, Write a recursive function to meet the following specification. You do not need to check the precondition template void increase(binary tree_node root_otr) I Precondition: root ptr is the root pointer of a binary trce // Pstcondition: Every node of the tree has had its data increased by one 10 Using the binary tree node rom Section 10.3, write recursive function to meet the following specification. You do not need to check the precondition template size-t many-nodes( binary-tree nodeItem>* root-ptr) I Precondition: root ptr is the root pointer of a binary tree Postcondition: The return valuc is the number of nodes in the tree NOTES: The empty tree has 0 nodes, and a tree with just a root has / l node 11. Using the binary_tree_node from Section 10.3, write a recursive function to meet the following specification. You do not need to check the precondition template int treedepth(binary tree node root_ ptr) I Precondition: root ptr is the root pointer of a binary trce I Postcondition: The return value is the depth of the inary tree I NOTES: The empty tree has a depth of and a tree with just a root // has depth of 0 12. Using the binary_ tree_node from Section 10.3, write a function to meet the following specification. You do not need to check the precondition template class Item> size t count42(binarytree node Item root_ptr) I Precondition: root ptr is the root pointer of a binary tree (but NOT NBCESSARILY a search tree) / Postcondition: The return value indicates how many times 42 appears /1 in the tree. NOTE: If the tree is empty, the function returns zero

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!