Skip to content
Official PYQ · 2025

GATE CS 2025 Set 1 Q16 — Binary Search Trees

Explain with AI

Which of the following statement(s) is/are TRUE for any binary search tree (BST) having nn distinct integers?

Select all correct options
View worked solution

Answer: A;B

Let us analyze each statement for a Binary Search Tree (BST) containing nn distinct integers:

  • Statement A: True
    In a skewed BST (where each node has at most one child), the nodes are arranged in a linear chain. The path from the root to the deepest node contains all nn nodes, which corresponds to exactly n−1n-1 edges. Thus, the maximum path length from the root to any other node is n−1n-1.
  • Statement B: True
    By definition, the binary search tree property states that for any node, all elements in its left subtree are smaller than the node's key, and all elements in its right subtree are greater. An inorder traversal (Left-Root-Right) visits the nodes in strictly increasing order, producing a sorted sequence.
  • Statement C: False
    In the worst case (such as a skewed BST), the height of the tree is O(n)O(n). Consequently, searching for an element can take O(n)O(n) time, not O(log⁡2n)O(\log_2 n).
  • Statement D: False
    A Min-Heap requires the key of a parent node to be less than or equal to the keys of its children. A BST requires the left child to be smaller than the parent. For example, in a BST with root 1010 and left child 55, the parent (1010) is greater than its child (55), which violates the Min-Heap property.

Therefore, the correct options are A and B.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Binary Search Trees questions