Question

Fig. 1 illustrates a red-black tree, where a thick circle represents a black data-bearing node, a thin circle represents a red data-bearing node, and a thick rectangle represents a black nil node. In your work, you have to write black near a black node and write red near a red node to indicate the colors. Alternatively, you may use a rectangle to represent a black node, and use a circle to represent a red node.
15 50 10 23 58 D db D 00 Figure 1: A red-black tree.

- Draw the resulting red-black tree after inserting 24 into the red-black tree in Fig. 1. You only have to draw the portion of the tree that is affected.

- Draw the resulting red-black tree after deleting 25 from the red-black tree in Fig. 1. You only have to draw the portion of the tree that is affected.

- Draw the resulting red-black tree after deleting 65 from the red-black tree in Fig. 1. You only have to draw the portion of the tree that is affected.

- Which property or properties (give the property number) may be violated when inserting a new node into a red-black tree? Describe the violation before the fix-up.

- Which property or properties (give the property number) may be violated when deleting a node into a red-black tree? Describe the violation before the fix-up.

Please do not just post answers of other questions. answer this exact question only.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

3 0 a 5 35 (45 6565 l0 58 23 role U u black : Need to mtah

30 15 10 3 35 5 a8 58 之。 348

3 Can be placad a^ hodu 16

マ5 Res altant- hue· ațta deleting 50 50 40 24 5)65 d 5 Viohhon nade 3 - blask an4

60 deletr 6s To S5 nand o rotalr 58 nodes In all path muut be equal

30 1 S 50 S 8 23as lo ?o 0

Add a comment
Know the answer?
Add Answer to:
Fig. 1 illustrates a red-black tree, where a thick circle represents a black data-bearing node, a...
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