GATE CS 2024 Set 2 | Question 39
Programming & Data Structures › Trees · MCQ · 2 marks · Answer: A
- Question 39Programming & Data Structuresmcq2 marksA BST is built by inserting all elements of a set in some unknown order. Which can be determined from alone?
- A.Inorder traversal of T✓
- B.Root node of T
- C.Preorder traversal of T
- D.Postorder traversal of T
Answer: A
Solution
Answer: (A) The inorder traversal of any BST is the sorted order of its keys, which is determined by the set regardless of insertion order. The root, preorder, and postorder all depend on the (unknown) insertion sequence. - A.
More GATE PYQ on Trees
All GATE CS Programming & Data Structures PYQ →Attempt GATE CS 2024 Set 2 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →