QUESTION

Text
Image


Shunting yard Task: Implement shunting yard algorithm to turn a given infix expression to postfix notation as well executing the statement directly to produce the output. To simplify lexer, you can use one digit numbers. You are required to follow the following requirements in the program exactly (I will again read your programs automatically): 1- Your program should read a single line of input (there will be no spaces in the input). Do not ask the input. Directly use scanf, cin, gets whatever method you choose 2- Your program should support +-*/()^ $3^{-} \wedge$ is power operator and has highest precedence and is right to left, */ has same precedence left to right, +- has lowest precedence and is left to right 4- Your program should output two separate lines with no other output: - Post fix result with no spaces - Result of the expression 5- Your program should be written in C/C++/Haskell/Prolog/NodeJS/PHP these are the languages I have compiler ready for. 6- Your program should be able to handle at least 20 operators, input can be up to 40 characters.

Public Answer

YE1LRB The First Answerer