Convert the following infix expressions into equivalent postfix expressions: x *
ID: 3826952 • Letter: C
Question
Convert the following infix expressions into equivalent postfix expressions:
x * (y + z) - (w + t)
(x + y) / (z - w) * t
((x - y) + (z - w) / t) * u
x - y / (z + w) * t / u + (v - s)
A+B-C
(A+B)*C
(A+B)*(C_D)
(A+((B+C)*(E-F)-G)/(H-I)
A+B*(C+D)-E/F+G+H
Convert the following postfix expressions into equivalent infix expressions (remember, order of operands can't change):
x y + z * w -
x y * z / w +
x y z + * w -
Evaluate the following postfix expressions (meaning, computing it to a single number):
17 5 3 - * 6 + =
14 2 * 8 + 6 / 5 + =
15 16 3 10 2 + + - + 8 / =
1 8 12 - - 9 + 25 5 / * =
Explanation / Answer
1.x * (y + z) - (w + t) equivalent postfix is xyz+w*t+
2.(x + y) / (z - w) * t postfix equivalent xy+zw-/t*
3. ((x - y) + (z - w) / t) * u postfix equivalent xy+zw-t/+u*
4. x - y / (z + w) * t / u + (v - s) postfix equivalent xyzw+/t*u/-vs-+
5. A+B-C postfix equivalent AB+C-
6 (A+B)*C postfix equivalent AB+C*
7. (A+B)*(C-D) postfix equivalent AB+CD-*
8. (A+((B+C)*(E-F)-G)/(H-I) postfix equivalent ABC+EF--G*HI-/(
9. A+B*(C+D)-E/F+G+H postfix equivalent is ABCD+-E*F/+G+H+
Postfis to infix
1.xy+z*w- infix equivalent (x + y) * z - w
2. x y * z / w + infix equivalent x * y / z + w
3.x y z + * w - infix equivalent x * (y + z) - w
Evaluate postfix expressions
1. 17 5 3 - * 6 +
= 17*(5-3)+6
= 17*2+6=34+6=40
2.14 2 * 8 + 6 / 5 +
=((14*2)+8)/6+5
=(28+8)/6+5
= 36/6+5=6+5=11
3. 15 16 3 10 2 + + - + 8 /
=(15+(16-(3+(10+2)))/8
= 2
4. 1 8 12 - - 9 + 25 5 / *
= ((1-(8-12))+9)*(25/5)
=70