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?
- A.
Black, if the new node is not a root node
- B.
Red, if the new node is not a root node
- C.
Black, if the new node is a root node
- 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.