Question

Draw the binary search tree that results from starting with an empty tree and a. adding 50 72 96 94 26 12 11 9 2 10 25 51 16 C D E F only please
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Binary search tree is a binary tree structure where each node has value less than it to the left and values greater to it to its right.

As only E and F are required, here is the solution -

(e)

1. Add so 60 2. Add 72 to right of so (50 3. Add 96 to right of 72 150 (96 4. 94 is added to left of 96 70 (96 194 5. 26 is a

50 (96 (12 1947 Il is added left of 12 and 9 is added left of 11 50 (96 9 7. 2 is added left of a and 10 is added eight of 9

8. Delete 50 50 has a children (a) Find its inpoder successes Celement which comes after 50 while in order traversal In order

And recursively delete the children. Hence the final tree becomes -

72 12 96 94 न TO

(f)

The values inserted are the same as part e.

1. Delete 12, 12 has 1 child

Replace 12 with its child (11) and delete the child recursively.

50 72 7) 4 94 Z

2. Delete 72, 72 has 1 child

Replace 72 with its child (96) and delete 96

Replace 96 with its child 94 and delete 94 (has no child).

Hence the final tree becomes -

50 96 (4 (2- 10

Add a comment
Know the answer?
Add Answer to:
C D E F only please Draw the binary search tree that results from starting with...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT