Data Structures · Question 7 · Medium

What is the postfix form of the infix expression A + B * C - D ?

  1. A B + C * D -
  2. A B C + * D -
  3. A B C * + D -
  4. A B C D - * +
Answer and explanation

Answer: C. A B C * + D -

Explanation: * has higher precedence, so the expression is (A + (B * C)) - D. Converting gives A B C * +, then D - is applied: A B C * + D -.

Previous: An inorder traversal of a Binary Search Tree (BST) lists the keys in which… · Next: A binary tree has height 4, where height is the number of edges on the longest…

Practise data structures

Try a fresh set of data structures questions with an explanation after every answer, free and without signing up: Data Structures practice. Or sit a full placement mock test.

More data structures questions

More technical & programming practice

Algorithms · Object-Oriented Programming · DBMS · SQL · Operating Systems · Computer Networks · Software Engineering · Cloud & DevOps

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge