Question: 1 Binary Search Trees (25 points) Consider the binary tree as shown in Figure 1. 9 5 15 10 17 8 Figure 1: Binary Tree:

 1 Binary Search Trees (25 points) Consider the binary tree asshown in Figure 1. 9 5 15 10 17 8 Figure 1:

1 Binary Search Trees (25 points) Consider the binary tree as shown in Figure 1. 9 5 15 10 17 8 Figure 1: Binary Tree: The letter next to each node (e.g., a, b) denotes the tree node, and the number inside each node is the key. 1.1 Correctness (10 points) Is this binary tree a valid binary search tree? In other words, does it satisfy the binary search tree property? If not, which node(s) violates the binary search tree property, and why? How would you modify the violating node(s) to make the binary tree a valid binary search tree? Hint: You will lose points if your answer includes tree nodes that do NOT violate the binary search tree property. Insertion (5 points) If we insert a node with key 18 into the binary search tree in Figure 1 (or the corrected version if you need to modify the tree node(s) in the first question), how would the binary search tree look like after the insertion? Please draw the binary search tree as in Figure 1

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!