Question: Professor Bunyan thinks he has discovered a remarkable property of binary search trees. Suppose that the search for key k in a binary search tree
Professor Bunyan thinks he has discovered a remarkable property of binary search trees. Suppose that the search for key k in a binary search tree ends up in a leaf. Consider three sets: A, the keys to the left of the south path; B, the keys on the search path; and C, the keys to the right of the search path. Professor Bunyan claims that any three keys a ( A, b ( B, and c ( C must satisfy a ¤ b ¤ c. Give a smallest possible counterexample to the professors claim.
.png)
.png)
Figure 1: Counter example to Professor Bunyan's claim. The set A is empty. The search path, where search is performed for the key 3 is marked. The search proceeds from root 8 to the node 4 and this to node 3. So B = (8, 4, 4) Set C is the only key to the right of the path, i.e., C = (8).
Set B (8 Set C Set A (3.
Step by Step Solution
★★★★★
3.50 Rating (177 Votes )
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
The claim is wrong A simple counter example is shown in figure 1 In the fi... View full answer
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
Document Format (1 attachment)
1019-B-C-A-T-A(1851).docx
120 KBs Word File
