Which of the following trees are height balanced?
A. Binary Search Tree
B. AVL Tree
C. Red-Black Tree
D. B Tree
Choose the correct answer from the options given below:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. B, C and D Only
Explanation
A plain BST can become skewed (height n). AVL trees keep the balance factor within ±1, red-black trees keep height ≤ 2 log(n+1), and B-trees keep all leaves at the same level. So B, C and D are height balanced.More Data Structures and Algorithms questions
- Which of the following algorithms use the Greedy strategy? A. Dijkstra's algorithm B. Kruskal's algorithm C. Huffman coding D. Bellman-Ford…
- The longest common subsequence of {1,2,3,2,4,1,2} and {2,4,3,1,2,1} is
- Match List I (Hashing Collision Handling Method) with List II (Strategy)List I List II A. Chaining I. Check next slot B. Linear Probing II.…
- Maintaining a graph in memory by means of its adjacency matrix is known as
- Match List I with List IIList I List II A. Circular Queue I. Print Queue B. Priority Queue II. CPU Scheduling C. Double Ended Queue III. Di…
- The tight asymptotic bound for the recurrence T(n) = 2T(n/4) + √n is