[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Interview Questions and Answers :: Happiest Minds

22. What is balance tree, do you know red-black tree?

Answer:

A tree is called as balance tree if the difference between heights of left subtree and right subtree is not more than 1.


A Red-Black Tree is a self-balancing Binary Search Tree (BST) where every node follows the below following rules.
RedBlackTree
1) Every node has a color either red or black.

2) Root of tree is always black.

3) There are no two adjacent red nodes (A red node cannot have a red parent or red child).

4) Every path from root to a NULL node has same number of black nodes.

Post Your Answer Here:      Public      Private

Rate This: +0 -0
Report     

Post Your Reply Here:     

Report Error

Report Error

Please Login First Click Here