COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
operator
|
|
operand
|
|
Either A or B
|
|
None of the above
|
Detailed explanation-1: -Prefix expression notation requires that all operators precede the two operands that they work on. Postfix, on the other hand, requires that its operators come after the corresponding operands. A few more examples should help to make this a bit clearer (see Table 2). A + B * C would be written as + A * B C in prefix.
Detailed explanation-2: -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-3: -Reverse Polish notation (RPN), also known as reverse Łukasiewicz notation, Polish postfix notation or simply postfix notation, is a mathematical notation in which operators follow their operands, in contrast to Polish notation (PN), in which operators precede their operands.
Detailed explanation-4: -This type of notation is referred to as infix since the operator is in between the two operands that it is working on. Consider another infix example, A + B * C.
Detailed explanation-5: -A prefix operator immediately precedes its operand, as in −x. A postfix operator immediately succeeds its operand, as in x! for instance. An infix operator is positioned in between a left and a right operand, as in x+y.