In line 16 of RB-INSERT, we set the color of the newly inserted node z to red.

Question:

In line 16 of RB-INSERT, we set the color of the newly inserted node z to red. Observe that if we had chosen to set z’s color to black, then property 4 of a red black tree would not be violated. Why didn’t we choose to set z’s color to black?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Introduction to Algorithms

ISBN: 978-0262033848

3rd edition

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

Question Posted: