Skip to main content

GATE CSE 2025Data Structures › Trees & Binary Search TreesVerified

GATE CSE 2025 PYQ: Which of the following statement(s) is/are TRUE for any binary search tree (BST) having n n n distinct…

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

  1. A
    The maximum length of a path from the root node to any other node is (n−1)(n-1).
    Correct answer
  2. B
    An inorder traversal will always produce a sorted sequence of elements.
    Correct answer
  3. C
    Finding an element takes O(log⁡2n)O\left(\log _{2} n\right) time in the worst case.
  4. D
    Every BST is also a Min-Heap.

Answer

(A, B) The maximum length of a path from the root node to any other node is ( n − 1 ) (n-1) ( n − 1 ) .; An inorder traversal will always produce a sorted sequence of elements.

Approach

Evaluate each statement against the fundamental properties of a general (not necessarily balanced) BST with n distinct keys. Key facts: a BST can degenerate into a chain of height n−1; inorder traversal of a BST yields sorted order; worst-case search is O(n); and the min-heap property (parent ≤ children) is incompatible with the BST ordering.

Only statements A and B follow from properties that hold for every BST. C assumes balance (not guaranteed), and D confuses the heap ordering with the BST ordering.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.