Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program to evaluate empirically the following strategies for removing no

ID: 674532 • Letter: W

Question

Write a program to evaluate empirically the following strategies for removing nodes

with two children:

a. Replace with the largest node,X, inTL and recursively remove X.

b. Alternately replace with the largest node in TL and the smallest node in TR, and recursively remove the appropriate node.

c. Replace with either the largest node in TL or the smallest node in TR (recursively removing the appropriate node), making the choice randomly.

Which strategy seems to give the most balance? Which takes the least CPU time to process the entire sequence?

Explanation / Answer

+ 3 means inserting 3 into the current BST.
- 5 means removing 5 from the current BST if 5 is in the BST.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote