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:
Hi @Ashish Deshmukh ji very good answer. If someone is thinking about proof then think proof via technique like induction.
Great observation
CS:Common sense(Another Full form of Computer Science)
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)
-((*76)+1))(((*43)-5)^2)
-(+1*76)((-5*43)^2)
-+1*76^2-5*43
so option c is right
Gatecse
@