Correct option is D
Height-balanced trees are specifically designed to maintain balance in terms of height during insertions and deletions to ensure optimal time complexity for search operations. Among the listed options,
AVL Tree and
Red-Black Tree are both height-balanced binary search trees that use balancing mechanisms to control tree height. AVL trees are strictly balanced using height differences, while Red-Black Trees maintain a more relaxed balance using color properties. Hence,
only B and C qualify as height-balanced trees.
Information Booster:
1.
AVL Tree:
· Stands for Adelson-Velsky and Landis Tree.
· It is a
strictly height-balanced binary search tree.
· The difference between the heights of left and right subtrees is at most 1 for every node.
2.
Red-Black Tree:
· A type of
self-balancing binary search tree.
· Balances the tree using a set of color-based rules.
· Guarantees that the longest path is no more than twice the shortest, maintaining near-perfect balance.
Additional Knowledge:
·
Binary Search Tree (BST): Not necessarily height-balanced. The height depends on the order of insertion and can degenerate into a linked list in the worst case.
·
B Tree: Used primarily in database systems and disk storage;
balanced in terms of keys and node distribution, not height-balanced like AVL or Red-Black Trees. It ensures all leaf nodes are at the same level but does not balance based on node heights like AVL or RBT.