What would be the color of newly created node while inserting a new element in…

2024

What would be the color of newly created node while inserting a new element in a Red black tree?

  1. A.

    Black, if the new node is not a root node

  2. B.

    Red, if the new node is not a root node

  3. C.

    Black, if the new node is a root node

  4. D.

    Both b and c

Attempted by 132 students.

Show answer & explanation

Correct answer: D

Answer: d

Explanation: The answer is d. The property of Red Black tree is that if the newly created node is a root node then the color of the node would be Black otherwise the color of the node would be Red.

Explore the full course: Coding For Placement