UGC-NET Jun 2012 · Trees

MCQ · 2 marks · Problem PROG-DSTR-0010

A binary search tree is a binary tree in which
  1. A
    All items in the left subtree are less than root
  2. B
    All items in the right subtree are greater than or equal to root
  3. C
    Each subtree is itself a binary search tree
  4. D
    All of the above

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

Show the worked solutionA binary search tree is defined recursively: the left subtree holds keys smaller than the root, the right subtree holds keys greater than or equal to the root (when duplicates are allowed), and both subtrees are themselves binary search trees.(A) Left items less than the root — part of the definition.(B) Right items greater than or equal to the root — part of the definition.(C) Each subtree is again a BST — part of the definition.All three hold together.Answer: D

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