Consider the following New-order strategy for traversing a binary tree:
The New-order traversal of the expression tree corresponding to the reverse polish expression
3 4 * 5 - 2 ^ 6 7 * 1 + -
is given by:
Its quite simple actually.
Postorder: left, right, root
Neworder: Root, right, left
(left, right, root) and (Root, right, left) are reverse of each other, right ?
So, these two traversals will be exact reverse of each other! Option (c) ! Answer in few seconds, basic concept ! Observation !
Hi @Ashish Deshmukh ji very good answer. If someone is thinking about proof then think proof via technique like induction.
Another way to go => Answer C
1. Convert Postfix to Infix
2. Create expression tree.
3. Run the code !
Reverse polish notation is postfix notation ,so we have postfix form expression
Firstly we have to convert POSTFIX -> INFIX
Which can be converted as given in my reference answer https://gateoverflow.in/8408/gate2015-3_12
Infix - > (((3*4)-5)^2)-((6*7)+1))
So new order is Root Right Left
- ((6*7)+1) (((3*4)-5)^2)
so option c is right