You are on page 1of 2

ASSIGNMENT ON STACKS (INFIX TO POST FIX

AND EVALUATION)
1. Evaluate the following POSTFIX notation. Show status of stack after every step of
evaluation (i.e. after each operator):
True,False,NOT,AND,False,True,OR,AND

2. Evaluate the following postfix notation of expression: 2


True, False, AND, True, True, NOT, OR, AND
3. Convert the following infix expression to its equivalent postfix expression showing stack
contents for the conversion:
X–Y /(Z + U) * V

ANS

4. A + B * (C – D) / E

ANS
5. Evaluate the following postfix notation of expression (Show status of stack after
execution of each operation ): 2
4, 10, 5, +, *, 15, 3, /, -

ANS

6. Evaluate the following postfix notation of expression (Show status of stack after
execution of each operations):
5, 20, 15, -, *,25, 2, *, +

ANS
7. Evaluate the following postfix notation of expression : 2
25 8 3 - / 6 * 10 +
ANS
8. Obtain the postfix notation for the following infix notation of expression
showing the contents of the stack and postfix expression formed after each
step of conversion :
(P—Q)/(R*(S—T)+U)

ANS PQ-RST-*U+/
9. Convert the following infix expression into postfix. show the stack status after execution
of each operation:
i. TRUE OR FALSE AND NOT FALSE OR FALSE
ii. TRUE AND FALSE OR NOT FALSE OR FALSE AND TRUE

ANS: STUDENTS TRY OUT YOURSELF

You might also like