# Evaluation of a Postfix Expression Question with FREE PDF

The Evaluation of a Postfix Expression Question and Answer has been updated for FREE PDF. This contains all the questions and answers based on the latest exam. These Evaluation of a Postfix Expression Question and Answer with FREE PDF will help you prepare for any exam including BCA, MCA, GATE, GRE, IES, PSC, UGC NET, DOEACC Exams at all levels – you just have to practice regularly.

## Evaluation of a Postfix Expression Question

a) abc*+

b) abc+*

c) ab+c*

d) a+bc*

a) a*b(c+d)

b) abc*+de-+

c) +ab

d) a+b-c

a) True

b) False

a) O (N)

b) O (N log N)

c) O (N2)

d) O (M log N)

a) True

b) False

a) ‘(‘ and ‘)’

b) ‘*’ and ‘/’

c) ‘~’ and ‘^’

d) ‘+’ and ‘-‘

##### 7. Which of the following is not an application of stack?

a) evaluation of postfix expression

b) conversion of infix to postfix expression

c) balancing symbols

d) line at ticket counter

##### 8. While evaluating a postfix expression, when an operator is encountered, what is the correct operation to be performed?

a) push it directly on to the stack

b) pop 2 operands, evaluate them and push the result on to the stack

c) pop the entire stack

d) ignore the operator

Answer: pop 2 operands, evaluate them and push the result on to the stack

##### 9. Which of the following statement is incorrect?

a) Postfix operators use value to their right

b) Postfix operators use value to their left

c) Prefix operators use value to their right

d) In postfix expression, operands are followed by operators

Answer: Postfix operators use value to their right

a) 4

b) 5

c) 6

d) 7

##### 11. What is the result of the following postfix expression?

ab*cd*+ where a=2,b=2,c=3,d=4.

a) 16

b) 12

c) 14

d) 10

##### 12. Consider the stack

| 5 |
| 4 |
| 3 |
| 2 |.

At this point, ‘*’ is encountered. What has to be done?

a) 5*4=20 is pushed into the stack

b) * is pushed into the stack

c) 2*3=6 is pushed into the stack

d) * is ignored

Answer: 5*4=20 is pushed into the stack

a) 23

b) 15

c) 6

d) 10

##### 14. Evaluate and write the result for the following postfix expression

abc*+de*f+g*+ where a=1, b=2, c=3, d=4, e=5, f=6, g=2.

a) 61

b) 59

c) 60

d) 55

##### 15. What is the other name for a postfix expression?

a) Normal polish Notation

b) Reverse polish Notation

c) Warsaw notation

d) Infix notation