Blog on algorithms, puzzles, programming .... musings of a computer engineer.
converting from infix to prefix
How do you convert a infix express to prefix. Ex: a+b*c -> +a*bc
Solution: 1. Scan the expression backwards, and use the same logic as that of conversion to postfix algo. Then reverse the constructed string. or 2. Using two stacks.*
No comments:
Post a Comment