Shunting yard algorithm
Input String
Available operators:
-
,
+
,
*
,
/
,
^
Tokenized Input:
3
NUM
+
OP
4
NUM
*
OP
2
NUM
/
OP
(
PARA
1
NUM
-
OP
5
NUM
)
PARA
^
OP
2
NUM
^
OP
3
NUM
Compute Reverse Polish Notation (RPN):
Token
Action
Reverse Polish Notation (RPN)
Op. Stack
Resolve RPN to Result:
Token
Action
Reverse Polish Notation (RPN)
Number Storage
Result:
References:
Shunting yard algorithm
Video on Shunting yard by Javid9x