35 35 votes Which of the following is/are correct in order traversal sequence(s) of binary search tree(s)? $3, 5, 7, 8, 15, 19, 25$ $5, 8, 9, 12, 10, 15, 25$ $2, 7, 10, 8, 14, 16, 20$ $4, 6, 7, 9, 18, 20, 25$ I and IV only II and III only II and IV only II only Data Structures gatecse-2015-set1 data-structures binary-search-tree easy + – Misbah Ghaya 12.0k views answer comment Share Follow Print See all 7 Comments 7 7 Comments reply pankaj_vir commented Mar 24, 2018 reply Follow flag Inorder traversal gives nodes in non-decreasing order 2 2 replyShare chauhansunil20th commented Nov 29, 2018 reply Follow flag In $Inorder$ traversal first left node is printed then root node and finally right node. $Left Node -> Root Node -> Right Node$ In a BST, $Left Node=< Root Node < Right Node$ Hence, Inorder always traverses the BST in ascending order. 1 1 replyShare s_dr_13 commented Jul 17, 2020 reply Follow flag It is unbelievable that GATE is asking such questions 2 2 replyShare Vishal_kumar98 commented Oct 24, 2020 reply Follow flag Look it as a whole paper point of view. I did the same mistake thinking like this for JEE questions. Try to solve the whole set of 65 questions and then in that you won't feel the same about this question. 4 4 replyShare Ayush_Ghonge commented May 27, 2025 reply Follow flag why because its too easy? 0 0 replyShare vxi lin commented Oct 1, 2025 reply Follow flag yes @Ayush _24 0 0 replyShare chidambareswar23 commented Dec 18, 2025 reply Follow flag Similar questions: Finding in-order traversal = ascending order of nodesData Structures: GATE CSE 2003 | Question: 19, ISRO2009-24Data Structures: GATE CSE 2005 | Question: 33Data Structures: GATE CSE 2015 Set 1 | Question: 10 1 1 replyShare Please log in or register to add a comment.
Best answer 41 41 votes In order traversal of key are always in ascending order. So, here I & IV th sequence are in ascending order so Option A is Answer. Rajesh Pradhan answered Aug 25, 2016 • edited Jun 13, 2018 by Milicevic3306 Rajesh Pradhan comment Share Follow See 1 comment 1 1 comment reply Sachin Mittal 1 commented Jan 17, 2017 reply Follow flag This is not quick, it's ONLY solution for this problem :D :) 24 24 replyShare Please log in or register to add a comment.
12 12 votes option A is right .. chek for left root right rule Anoop Sonkar answered Feb 12, 2015 Anoop Sonkar comment Share Follow See 1 comment 1 1 comment reply Sankha Narayan Bose commented Mar 24, 2018 reply Follow flag A... 0 0 replyShare Please log in or register to add a comment.
1 1 vote Simply look for the sequences having ascending order, that's it! You'll get the answer! TheAnteamatter answered Jun 22, 2020 TheAnteamatter comment Share Follow 0 reply Please log in or register to add a comment.
1 1 vote most easiest question in gate history just follow ascending order ankit2024 answered Nov 22, 2025 • edited Nov 28, 2025 by ankit2024 ankit2024 comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes AnswerThe correct option is (A) I and IV only.ExplanationIn a Binary Search Tree (BST), the Inorder Traversal always results in the keys being visited in strictly ascending (increasing) order. This is a fundamental property because the inorder traversal visits nodes in the sequence: Left Subtree $\to$ Root $\to$ Right Subtree.To solve this question, we simply need to check which of the given sequences are sorted in ascending order:I. 3, 5, 7, 8, 15, 19, 25: This sequence is in ascending order. (Valid)II. 5, 8, 9, 12, 10, 15, 25: This sequence is not in ascending order ($12 > 10$). (Invalid)III. 2, 7, 10, 8, 14, 16, 20: This sequence is not in ascending order ($10 > 8$). (Invalid)IV. 4, 6, 7, 9, 18, 20, 25: This sequence is in ascending order. (Valid)Since only sequences I and IV are correctly sorted, they are the only possible inorder traversals for a BST. addressisvivek answered Jan 12 addressisvivek comment Share Follow 0 reply Please log in or register to add a comment.