Skip to main contentSkip to solution

Stack is commonly used data structure to convert infix expression to ____ and ______.

(A) PreStack

(B) Prefix

(C) Postfix

(D) PostStack

Solution

✅ Correct Option: 1

A stack is used to convert an infix expression (operators between operands, like A+BA + B) into prefix (operator before operands, like +AB+AB) and postfix (operator after operands, like AB+AB+). The stack holds operators and brackets temporarily, so that precedence and associativity are respected in the output.


PreStack and PoststStack are not standard expression notations. The valid notations are only infix, prefix and postfix.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question