Given the expression (A + B * D)/(E − F) + G: 1. The prefix notation is + / + A * D B − E F G. 2. The prefix expression is the reverse of the postfix expression. 3. The order of operands in infix and postfix is the same. 4. The order of operands in infix, prefix and postfix is the same.
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. 3 and 4 Only
Explanation
The correct prefix form is + / + A * B D − E F G, so statement 1 (with D B) is wrong. Prefix is not simply postfix reversed (2 false). Converting between notations moves only operators, so operands keep their order in all three forms (3 and 4 true).
More Data Structures and Algorithms questions
- Match List I with List II
- Given the graph below one of the following edges cannot be added in that order to find a minimum spanning tree algorithm. Q I. a-b II. d-f…
- Statement 1: su Given a graph G=(V, E) in which each vertex v € V has an associated positive weight w(v), we can Q use linear programming t…
- The solution of the recurrence T(n) = 3T(n/4) + n log n is
- Consider a B-tree of height h and minimum degree t ≥ 2 containing n keys, n ≥ 1. Which is correct?
- How many rotations are required during the construction of an AVL tree if the elements 35, 50, 40, 25, 30, 60, 78, 20, 28 are added in this…