Stack Operations – 1 Multiple Questions and Answers.




16. What is the result of the following operation Top (Push (S, X))
A. X
B. Null
C. S
D. None

17.The prefix form of an infix expression p + q - r * t is?
A. + pq - *rt
B. - +pqr * t
C. - +pq * rt
D. - + * pqrt

18. The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?
A. 600
B. 350
C. 650
D. 588

19.Convert the following infix expressions into its equivalent postfix expressions (A + B ⋀D)/(E - F)+G:
A. (A B D ⋀ + E F - / G +)
B. (A B D +⋀ E F - / G +)
C. (A B D ⋀ + E F/- G +)
D. none of these

20.Convert the following Infix expression to Postfix form using a stack:

x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.

A. xyz*+pq*r+s+*
B. xyz*+pq*r+s*+
C. xyz+*pq*r+s*+
D. none of these

«»



Quick Links

GAT Subject



   Computer Science    English    Agriculture    Botany    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC    PPSC    NTS