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

Practice Questions

Q1
Which of the following properties is NOT true for Red-Black trees?
  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 Red-Black trees?
  • Step 1: Understand what a Red-Black tree is. It is a type of binary search tree that has specific properties to keep it balanced.
  • Step 2: Learn the properties of Red-Black trees. 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 asks which property is NOT true. We need to find a property that contradicts the known properties.
  • Step 5: Since all leaves must be black, if a statement says that leaves can be red, that would be false.
  • Step 6: Conclude that the property stating leaves can be red is NOT true for Red-Black trees.
No concepts available.
Soulshift Feedback ×

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

Not likely Very likely