MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In the prefix notation, as the name suggests the operator is placed ____ the operands.
A
before
B
after
C
both a and c
D
none of above
Explanation: 

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.

Detailed explanation-2: -Prefix Notation In this notation, operator is prefixed to operands, i.e. operator is written ahead of operands. For example, +ab.

Detailed explanation-3: -Prefix notation is the notation in which operators are placed before the corresponding operands in the expression. Postfix Notation: Postfix notation is the notation in which operators are placed after the corresponding operands in the expression.

Detailed explanation-4: -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-5: -Prefix notation puts the operator before all of the operands. This means that the precedence is always clear. We are going to compare the Infix notation to this Prefix notation. so to derive the prefix equivalent we simply take the operator then move from left to right reading off the operands in left-to-right order.

There is 1 question to complete.