An operation that displays the contents of a stack can be us
Solution
HI, Friend, I have answered problem 3. Please do not post big problems in one post.
Please repost problem 4 separetly.
Problem 3)
/ and * have same precedence
+ and- have same precedence
AND, (/ *) have higher precedence than (+ -)
bracket has higest precedende
Also, + - * / = has Left to Right associativity
a)
a-b+c
= (ab-)+c
=ab-c+
b)
a-(b/c*d)
= a - (bc/ * d)
= a - (bc/d*)
= abc/d*-
c)
a/(b*c)
= a/(bc*)
abc*/
d)
a/b/c-(d+e)*f
= a/b/c-(de+)*f
= (ab/)/c-(de+)*f
= (ab/c/)-(de+)*f
= (ab/c/) - (de+f*)
= ab/c/de+f*-
e)
(a+b)*c
= (ab+)*c
= ab+c*
f)
a*(b/c/d)+e
= a*((bc/)/d)+e
= a*(bc/d/)+e
= (abc/d/*)+e
= abc/d/*e+
g)
a-(b+c)
= a - (bc+)
= abc+-
h)
a-(b+c*d)/e
= a - (b + (cd*))/e
= a -(bcd*+)/e
= a - (bcd*+e/)
= abcd*+e/-

