Which property is NOT true for Red-Black Trees?

Practice Questions

Q1
Which property is NOT true for Red-Black Trees?
  1. Every node is either red or black
  2. The root is always black
  3. All leaves are red
  4. Red nodes cannot have red children

Questions & Step-by-Step Solutions

Which property is NOT true for Red-Black Trees?
  • 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 Red-Black Trees. They include: 1) Every node is either red or black, 2) The root is always black, 3) Red nodes cannot have red children (no two reds in a row), 4) Every path from a node to its descendant NIL nodes must have the same number of black nodes.
  • Step 3: Identify the leaves of a Red-Black Tree. The leaves are the NIL nodes, which are the endpoints of the tree.
  • Step 4: Check the color of the leaves (NIL nodes). In Red-Black Trees, all NIL nodes are black.
  • Step 5: Conclude that the statement 'all leaves (NIL nodes) are black' is true, and therefore the property that is NOT true is that they can be red.
No concepts available.
Soulshift Feedback ×

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

Not likely Very likely