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 the infix expression and postfix expression is the same.
4. The order of operands in the infix, prefix and postfix expressions is the same.
Choose the most appropriate answer from the options given below:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. 3 and 4 only
Explanation
Correct prefix: + / + A * B D − E F G (statement 1 has D B). Postfix A B D * + E F − / G +. Prefix is not its reverse. Operand order A B D E F G is the same in all three forms.More Data Structures and Algorithms questions
- Match List I with List II. Choose the correct answer from the options given below:List I List II a. Dijkstra's algorithm I. Calculates path…
- For the weighted graph below, which of the following orders of adding edges can NOT be produced by a minimum spanning tree algorithm? Edges…
- Statement I: Given a graph G = (V, E) in which each vertex v ∈ V has an associated positive weight w(v), we can use linear programming to f…
- Assume that f(n), g(n) and h(n) are asymptotically positive. Which of the following is correct?
- The solution of the recurrence relation T(n) = 3T(n/4) + n log n is
- The number of nodes of height h in any n-element heap is at most