[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 :: HCL Technologies

3. Which is efficient in respect to searching AVL tree or RED BLACK tree.

Answer:

RB-Trees are, as well as AVL trees, self-balancing. Both of them provide O(log n) lookup and insertion performance.
In respect to searching AVL tree is efficient then Red-Black Tree because they are more rigidly balanced.. The path from the root to the deepest leaf in an AVL tree is at most ~1.44 lg(n+2), while in red black trees it's at most ~2 lg (n+1).
But if your application required frequent insertions and deletions, then Red Black trees should be preferred over AVL tree.

Post Your Answer Here:      Public      Private

Rate This: +0 -0
Report     

Post Your Reply Here:     

Report Error

Report Error

Please Login First Click Here