Question: 1.)Draw two different binary search trees, both having the values: 2, 4, 5, 7, 9, 10, 11, 14, 15, 22. The first tree should be

1.)Draw two different binary search trees, both having the values: 2, 4, 5, 7, 9, 10, 11, 14, 15, 22. The first tree should be a complete tree. The second tree should be a balanced tree but not complete. Hint: Determine the tree structure first, then fill in the values so its a BST

2.)Remove the root of your complete tree from Question 2 and draw the resulting tree.

3.) Write preorder, postorder, inorder and level order traversals of the tree you drew in Question 3.

4.)Implement a recursive function void postOrder(BNode * root) to output the values in a binary tree using a postorder traversal. The struct BNode type has members: int val and BNode *left, *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!