0% found this document useful (0 votes)
40 views2 pages

Infix

The document shows the steps to evaluate two infix expressions to postfix notation using a stack. For the first expression (A * B - (C - D)) / (E + F), it is converted to AB*C-D--EF+/ in postfix notation. For the second expression (A + B) * C + D / (E + F * G) – H, it is converted to AB+C*DEFG*+/+H- in postfix notation.

Uploaded by

Jayachandra Jc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views2 pages

Infix

The document shows the steps to evaluate two infix expressions to postfix notation using a stack. For the first expression (A * B - (C - D)) / (E + F), it is converted to AB*C-D--EF+/ in postfix notation. For the second expression (A + B) * C + D / (E + F * G) – H, it is converted to AB+C*DEFG*+/+H- in postfix notation.

Uploaded by

Jayachandra Jc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

infix: (A + B) * C + D / (E + F * G) – H

(A * B - (C - D)) / (E + F)

Symbol stack output


( (
A ( A
* (* A
B (* AB
- (- AB*
( (-( AB*
C (-( AB*C
- (-(- AB*C
) (-(-) AB*C-

) (-) AB*C--
/ / AB*C--
( /( AB*C--
E /( AB*C—E
+ /(+ AB*C--E
F /(+ AB*C—EF
) /(+) AB*C—EF+/

symbol stack output


( (
A ( A
+ (+ A
B (+ AB
) (+) AB+
* * AB+
C * AB+C
+ + AB+C*
D + AB+C*D
/ +/ AB+C*D
( +/( AB+C*D
E +/( AB+C*DE
+ +/(+ AB+C*DE
F +/(+ AB+C*DEF
* +/(+* AB+C*DEF
G +/(+* AB+C*DEFG
) +/ AB+C*DEFG*+
- - AB+C*DEFG*+/+
H - AB+C*DEFG*+/+H-

AB+C*DEFG*+/+H-

You might also like