COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Post fix
|
|
Infix
|
|
Either A or B
|
|
None of the above
|
Detailed explanation-1: -In postfix notation, the operator appears after the operands, i.e., the operator between operands is taken out & is attached after operands. Example1 − Translate a ∗ d − (b + c) into Postfix form. Example2 − Convert a + (b ∗⊝ c) is in Postfix form.
Detailed explanation-2: -Consider once again the expression A + B * C. As shown above, A B C * + is the postfix equivalent. We have already noted that the operands A, B, and C stay in their relative positions. It is only the operators that change position.
Detailed explanation-3: -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.