edited by
1,020 views
0 votes
0 votes

If the postfix form of a string is $ABC +$ $– D^{*}$, the actual string is :

  1. $\left ( A-\left ( B+C \right ) \right )^{*}D$
  2. $\left ( \left ( A-B \right )+C \right )^{*}D$
  3. $\left ( \left ( A+B \right )-C \right )^{*}D$
  4. $\left ( A+\left ( B-C \right ) \right )^{*}D$
edited by

1 Answer

0 votes
0 votes

For Postfix to Infix, expression conversion push each character one by one into the stack. whenever operator occurs pop the top 2 elements from the stack and again push back to the stack till last.

steps are as follows:

Expression Stack
$ABC+-D*$ NULL
$BC+-D*$ $A$
$C+-D*$ $A, B$
$+-D*$ $A,B,C$
$-D*$ $A,(B+C),$
$D*$ $(A-(B+C)),$
$*$ $(A-(B+C)),D$
$$ $(A-(B+C))*D$

So option A is correct here.

 

Related questions

0 votes
0 votes
1 answer
2
0 votes
0 votes
1 answer
3
go_editor asked Mar 26, 2020
559 views
Consider the relation on the set of non-negative integers defined by $x \equiv y$ if and only if:$x$ $\text{mod}$ $3=3$ $\text{mod}$ $y$$3$ $\text{mod}$ $x \equiv 3$ $\te...
0 votes
0 votes
2 answers
4
go_editor asked Mar 26, 2020
1,485 views
Minimum number of individual shoes to be picked up from a dark room ( containing $10$ pair of shoes) if we have to get atleast one proper pair :$2$$20$$11$None of these