New-order traversal visits root, then right subtree in New-order, then left subtree in New-order. Find it for the tree of postfix expression “3 4 * 5 - 2 ^ 6 7 * 1 + -”.
The final minus is the root. Its right subtree (6×7)+1 is visited as “+ 1 * 7 6”. Its left subtree ((3×4)−5)^2 is visited as “^ 2 - 5 * 4 3”. Combining root, right and left gives “- + 1 * 7 6 ^ 2 - 5 * 4 3”, C.
More Trees and Binary Search Trees questions
GATE 2016 CS (CS2) Q50– How many insertion orders of 1,2,3,4,5,6,7 give a binary search tree of height six? A…
GATE 2017 CS (CS2) Q46– BST preorder is 12,8,6,2,7,9,10,16,15,19,17,20. Find its postorder.
GATE 2012 CS (CS1) Q57– Height counts edges on the longest downward path. Fill B1 and B2.
GATE 2013 CS (CS1) Q17– What is the tightest worst-case upper bound for inserting into a binary search tree with n…
GATE 2013 CS (CS1) Q53– A BST has preorder 30,20,10,15,25,23,39,35,42. Find its postorder.
GATE 2011 CS (CS1) Q39– An unlabelled binary-tree shape has n nodes and n distinct keys are supplied. In how many…