Red - black Trees pecularity - Data Structure

Q.  What is the pecularity of Red - black Trees?
- Published on 25 Aug 15

a. In red-black trees, the root do not contain data.
b. In red-black trees, the leaf nodes are not relevant and do not contain data.
c. In red-black trees, the leaf nodes are relevant but do not contain data.
d. Both a and c above

ANSWER: In red-black trees, the leaf nodes are not relevant and do not contain data.
 

    Discussion

  • Nihal   -Posted on 01 Apr 16
    In red-black trees, the leaf nodes are not relevant and do not contain data. A red black tree is a balanced binary search tree. In this tree every node is colored either red or black. Same as extended binary, it’s all null links are replaced with special nodes (external nodes) and there is no key value or does not contain any data.

    Properties of red black tree.
    • Root node is always black.
    • All external nodes are black.
    • Black node can have red or black children.
    • A red node cannot have red children.
    Red black tree

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)