Correct option is C
The
root node is always black in a Red-Black Tree, which ensures that the tree maintains balance properties essential for efficient operations like search, insert, and delete.
Important Key Points:
1. In a
Red-Black Tree, the
root node is always
black to help maintain balance.
2. The Red-Black Tree is a type of
self-balancing binary search tree where balancing is maintained using specific coloring rules.
3. This property ensures that the
longest path from the root to a leaf is no more than twice as long as the shortest path, which keeps operations efficient.
Knowledge Booster:
·
The root node is always red: This is incorrect. In a Red-Black Tree, the root node is
always black.
·
Every leaf (NIL) node is red: In a Red-Black Tree,
every leaf (NIL) node is actually
black.
·
The tree must be a complete binary tree: A
Red-Black Tree is not necessarily a complete binary tree, as it allows variability in structure while maintaining balanced properties.
·
Every internal node has exactly two children: This is false because internal nodes in a Red-Black Tree can have
one or two children, depending on the structure after rebalancing.