Which of the following is essential for converting an infix expression to the postfix form efficiently?
A. An operator stack // Infix to ( Postfix or Prefix )
B. An operand stack //Postfix or Prefix Evaluation
C. An operand stack and an operator stack //we never use two stacks
But for Prefix to (Infix or postfix) OR Postfix to (Infix or prefix) We can use a stack where both operator and operand can present simultaneously
D. A parse tree // Not relevant to this question
Hence, Option A is Answer.
http://condor.depaul.edu/ichu/csc415/notes/notes9/Infix.htm is a good read.
Are you sure to evaluate prefix expression we need only one stack ?
Attaching source for detailed answer.
"A disadvantage is, it makes you...