4 votes 4 votes Consider the following binary search tree T given below: Which node contains the fourth smallest element in T? Q V W X DS isro2014 data-structures binary-search-tree + – go_editor asked Jul 1, 2016 • edited Dec 9, 2022 by Lakshman Bhaiya go_editor 6.0k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply shivanisrivarshini commented Jun 5, 2016 reply Follow Share Answer is option C i.e W ?? 0 votes 0 votes ManojK commented Jun 5, 2016 reply Follow Share correct c 0 votes 0 votes ManojK commented Jun 5, 2016 reply Follow Share U is smallest then Q is second smallest W is greater than Q and X is smaller then W so X is third smallest . W is forth smallest 1 votes 1 votes Please log in or register to add a comment.
Best answer 14 votes 14 votes Inorder traversal of BST sorts the elements in ascending order . UQXWPVZY --> inorder traversal 4th smallest element is W. Kapil answered Jul 1, 2016 • selected Mar 11, 2017 by Kapil Kapil comment Share Follow See all 0 reply Please log in or register to add a comment.
6 votes 6 votes The In-order traversal of BST gives number in sorted order Here In-order traversal sequence is as follows U Q X W P V Z Y hence 4rth smallest will be W. Hence Option C) W will be the answer. rude answered Jun 5, 2016 rude comment Share Follow See all 0 reply Please log in or register to add a comment.
4 votes 4 votes Answer C) W In BST left child is smaller than root value and right child is greater than root value. srestha answered Jul 1, 2016 srestha comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes 1 st small = U 2 nd small = Q 3 rd small = X 4 th small = W option A rameshbabu answered Jul 1, 2016 rameshbabu comment Share Follow See 1 comment See all 1 1 comment reply shekhar chauhan commented Jul 1, 2016 i edited by shekhar chauhan Jul 1, 2016 reply Follow Share Answer : Option C ===> W 0 votes 0 votes Please log in or register to add a comment.