COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
^^^ABCD
|
|
^A^B^CD
|
|
ABCD^^^
|
|
AB^C^D
|
Detailed explanation-1: -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 * +.
Detailed explanation-2: -What would be the Prefix notation for the given equation? Explanation: Reverse the equation or scan the equation from right to left. Apply the infix-postfix algorithm. The equation inside the bracket evaluates to CB* and outside the bracket evaluates to A+ therefore getting CB*A+.
Detailed explanation-3: -Hence the correct answer is-+a*/bc^def.
Detailed explanation-4: -Prefix Notation In this notation, operator is prefixed to operands, i.e. operator is written ahead of operands. For example, +ab. This is equivalent to its infix notation a + b. Prefix notation is also known as Polish Notation.