InterviewSolution
Saved Bookmarks
| 1. |
What is the value of the postfix expression2 3 + 4 5 6 – – *(a) 19(b) 21(c) -4(d) 25This key question is from Application of Stacks in portion Application of Stacks of Data Structures & Algorithms IThe question was asked during an internship interview. |
|
Answer» CORRECT option is (d) 25 The best EXPLANATION: Given postfix expression : 2 3 + 4 5 6 – – * infix ⇒ (2 + 3)4 (5 – 6) – * ⇒ (2 + 3)*4 – (5 – 6) Hence, VALUE = (2 + 3) * (4 – (5 – 6)) = 5 *(4 – (-1)) = 5*5 = 25. |
|