1.

Infix to prefix conversion can be done using __________(a) two queues(b) two stacks(c) one stack and two queues(d) one stackI have been asked this question during an online interview.My question is from Trees in section Trees of Discrete Mathematics

Answer»

Right choice is (b) two stacks

Best explanation: In the infix EXPRESSION, the operator appears between the operands and in infix NOTATION if the operator appears before the operands in the expression. For the conversion between them two stacks are used efficiently. The IDEA is to use one STACK for operators and other to STORE operands.



Discussion

No Comment Found

Related InterviewSolutions