W
W
Weageoo2011-02-15 16:00:53
Algorithms
Weageoo, 2011-02-15 16:00:53

Converting between infix, prefix and postfix notation?

As far as I understand, the transition from infix to prefix or postfix notation is easier to do using the algorithm proposed by Dijkstrom (using the stack), and other transformations are through building an abstract syntax tree (parse tree, expression parse tree) and traversing it in various ways.
I'm wondering if there are implementations, pseudocode or descriptions of the algorithms PrefixToInfix, PostfixToInfix, PrefixToPostfix, PostfixToPrefix that are not based on expression trees , or if there are ways to recursively parse an infix form with incomplete brackets and with non-single-letter variables, build a parse tree from it .
The plan is to implement a program that receives an expression in one of the notations as input, and an expression in any other notation or a parse tree as output.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question