Question: Question 5: (a) A student believes that Binary Search Trees possess the following property. Suppose we search for a key and the matching node is

 Question 5: (a) A student believes that Binary Search Trees possess

Question 5: (a) A student believes that Binary Search Trees possess the following property. Suppose we search for a key and the matching node is a leaf node. Let L be the set of all nodes to the left of the search path, P the set of all nodes on the search path, and R be the set of all nodes to the right of the search path. The student claims that any three keys l E L pE P, and r e R must satisfy I S p Sr. Give a simple counter-example to prove that it is not the case. (3 marks) (b) Is the remove/delete operation for Binary Search Trees commutative? That is, does deleting nodes X then Y result in the same tree as deleting nodes Y then X? Argue why it is true or else give a counter-example. (2 marks)

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!