Discussion
Which is the post fix notation of (9 - 5) + 2
Answer: B
The postfix notation is 95 - 2 +.
In postfix each operator follows its two operands. Convert the inner expression first, then the outer one:
\[ \begin{aligned} (9 - 5) &\to 9\ 5\ - \\ (9 - 5) + 2 &\to 9\ 5\ -\ 2\ + \end{aligned} \]
Evaluating it on a stack gives 9 - 5 = 4 and then 4 + 2 = 6, as the original does. '59 -' would compute 5 - 9, the operands reversed, '2 + 95 -' puts an operator before its operands, and '92 + 5 -' computes 9 + 2 - 5, a different expression.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development