Question: Hey I was able to answer the first two questions of my HW but 3 and 4 are quite confusing. Recursion/Trees Trees: 3) Given an

Hey I was able to answer the first two questions of my HW but 3 and 4 are quite confusing. Recursion/Trees Trees: 3) Given an empty Binary Search Tree myTree with a variable draw a logical diagram of what the Binary Search Tree will look like after the given operations.

myTree.add(31); myTree.add(75); myTree.add(18); myTree.add(92); myTree.add(29); myTree.add(5); myTree.add(66);

Reminder - draw a logical diagram of the tree and show root!

4) Given the following Binary Search Tree of Strings, suppose we remove Mango, which node will be at the root?

Hey I was able to answer the first two questions of my

Suppose we remove Mango, which node will be at the root:

A) Using the removal algorithm we covered in class, pages 506-10, which node would you make the new root? (remember, you need to keep the tree as a binary search tree) B) Which condition was followed?

Note: you are not re-drawing the tree for this question, all you have to do is to submit your answers to the questions in A, and B

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!