GATE CS 2025 Set 1 | Question 26
Programming & Data Structures › Trees · MSQ · 1 mark · Answer: A, B
- Question 26Programming & Data Structuresmsq1 markWhich of the following statement(s) is/are TRUE for any binary search tree (BST) having distinct integers?
- A.The maximum length of a path from the root node to any other node is .✓
- B.An inorder traversal will always produce a sorted sequence of elements.✓
- C.Finding an element takes time in the worst case.
- D.Every BST is also a Min-Heap.
Answer: A, B
Solution
Answer: (A) and (B) - (A) A completely skewed BST (each node has one child) forms a chain of nodes → longest root-to-node path has edges. True (this is the maximum). - (B) Inorder traversal of a BST always visits keys in increasing order. True. - (C) Search is ; in the worst case (skewed tree) , so worst case is , not . False. - (D) A BST orders left root right; a Min-Heap requires parent children with no left/right ordering. A BST is generally not a min-heap. False. - A.
More GATE PYQ on Trees
All GATE CS Programming & Data Structures PYQ →Attempt GATE CS 2025 Set 1 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →