Which of the following properties is NOT true for a Red-Black tree?

Practice Questions

Q1
Which of the following properties is NOT true for a Red-Black tree?
  1. Every node is either red or black.
  2. The root is always black.
  3. All leaves (NIL nodes) are red.
  4. Red nodes cannot have red children.

Questions & Step-by-Step Solutions

Which of the following properties is NOT true for a Red-Black tree?
  • Step 1: Understand what a Red-Black tree is. It is a type of binary search tree with specific properties.
  • Step 2: Learn the properties of a Red-Black tree. There are five main properties.
  • Step 3: One of the properties states that all leaves (NIL nodes) must be black.
  • Step 4: Identify the question's focus. It asks which property is NOT true for a Red-Black tree.
  • Step 5: Recall that if all leaves are black, then they cannot be red. Therefore, the statement about leaves being black is true.
  • Step 6: Conclude that the property stating leaves can be red is NOT true for a Red-Black tree.
No concepts available.
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely