COMPUTER SCIENCE AND ENGINEERING
THEORY OF COMPUTATION
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Infix expression
|
|
Postfix expression
|
|
Afterfix expression
|
|
Between expression
|
Detailed explanation-1: -For example, the infix expression (2+3)*(4+5) in postfix notation is 23+45+* and the infix expression 2+3*4+5 in postfix notation is 234*+5+. Also, since our four operators are left associative, 2 + 3 + 4 translates to 23+4+ and not 234++.
Detailed explanation-2: -1 Answer. Hence, value = (2 + 3) * (4 – (5 – 6)) = 5 *(4 – (-1)) = 5*5 = 25.
Detailed explanation-3: -What is the postfix expression of 9+3*5/(10-4)? So the output is:9 3 5 / * + 10 4-. 7.
Detailed explanation-4: -A + B * C would be written as + A * B C in prefix. 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 * +.