MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the postfix expression for the infix expression:a-b-c?
A
a-b-c
B
ab-c-
C
____ abc
D
-ab-c
Explanation: 

Detailed explanation-1: -Explanation: Using the infix to postfix expression conversion algorithm, the corresponding postfix expression is found to be abc*+de*+.

Detailed explanation-2: -The postfix expression abc+de/*-is equivalent to which of the following infix expression? Hence, correct choice is a-(b+c)*(d/e). So, the equivalent infix expression is (1 + 2) * 3 – (4 * 5) and it’s value is-11.

Detailed explanation-3: -The multiplication operator comes immediately before the operands B and C, denoting that * has precedence over +. The addition operator then appears before the A and the result of the multiplication. In postfix, the expression would be A B C * +.

There is 1 question to complete.