can someone help me how to create a program like this? using any programming languages output: will be like this(you can use different programming languages if you want and please explain the code,
Thank you)
Output will be like this(conversion of postfix using tabulation method)
example: (A + B ^ C * D / E - F)
Symbol OPERATOR STACK PostFix(stack)
( ( Empty
A ( A
+ (+ A
B (+ AB
^ (+^ AB
C (+^ ABC
* (+* ABC^
D (+* ABC^D
/ (+/ ABC^D*
E (+/ ABC^D*E
- (- ABC^D*E/+
F (- ABC^D*E/+F
) Empty ABC^D*E/+F-
Conversion of postfix using tabulation method:
if symbol = operand push to post(stack)
symbol = operator
incoming(operator) > operator(stack) then push op(stack)
incoming(operator) <= operator(stack) then pop operator(stack) and push incoming(operator)
if symbol = ( then push operator(stack)
symbol = ) then pop all operator in operator(stack) until it meets an ( post stack.
if symbol = ^ then push it to operator(stack)