5 5 votes Consider the following binary search tree T given below: Which node contains the fourth smallest element in T?QVWX Data Structures isro2014 data-structures binary-search-tree + – go_editor 8.3k views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply shivanisrivarshini commented Jun 5, 2016 reply Follow flag Answer is option C i.e W ?? 0 0 replyShare ManojK commented Jun 5, 2016 reply Follow flag correct c 0 0 replyShare ManojK commented Jun 5, 2016 reply Follow flag 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 1 replyShare Please log in or register to add a comment.
Best answer 19 19 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 0 reply Please log in or register to add a comment.
7 7 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 0 reply Please log in or register to add a comment.
4 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 0 reply Please log in or register to add a comment.
1 1 vote 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 1 1 comment reply shekhar chauhan commented Jul 1, 2016 i edited by shekhar chauhan Jul 1, 2016 reply Follow flag Answer : Option C ===> W 0 0 replyShare Please log in or register to add a comment.
1 1 vote In these type of question,find INORDER traversal. INORDER TRAVERSAL is arranged in ascending order so in this question 4th element from starting of inorder traversal,i.e., W is 4th smallest element Regina Phalange answered Apr 5, 2017 Regina Phalange comment Share Follow 0 reply Please log in or register to add a comment.