UGC-NET Dec 2012 · Trees

MCQ · 2 marks · Problem PROG-DSTR-0014

In which tree, for every node the height of its left subtree and right subtree differ almost by 1?
  1. A
    Binary Search Tree
  2. B
    AVL Tree
  3. C
    Threaded Binary Tree
  4. D
    Complete Binary Tree

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionAn AVL tree is a height-balanced BST: at every node the heights of the left and right subtrees differ by at most 1 (balance factor \(-1,0,+1\)).(A) A plain BST has no balance condition — incorrect.(C) Threading adds pointers for traversal, not balance — incorrect.(D) A complete binary tree fills levels left to right; the condition is on the shape as a whole, and the defining per-node height property is that of AVL trees — incorrect.Answer: B

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com