Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Basic Calculator II
Bookmark
Shunting-Yard
Stack
Two Variables
Input
Example 1
Example 2
Example 3
Custom
s
=
3+2*2
3
+
2
*
2
RPN (postfix)
stack (operators)
3
+
2
*
2
RPN (postfix)
stack (operators)
3
+
2
*
2
i
RPN (postfix)
stack (operators)
3
+
2
*
2
i
RPN (postfix)
3
stack (operators)
+
3
+
2
*
2
i
RPN (postfix)
3
2
stack (operators)
+
3
+
2
*
2
i
RPN (postfix)
3
2
stack (operators)
+
*
3
+
2
*
2
i
RPN (postfix)
3
2
2
*
stack (operators)
+
*
3
+
2
*
2
RPN (postfix)
3
2
2
*
+
stack (values)
+
3
+
2
*
2
RPN (postfix)
3
2
2
*
+
stack (values)
3
2
3
+
2
*
2
RPN (postfix)
3
2
2
*
+
stack (values)
3
4
3
+
2
*
2
RPN (postfix)
3
2
2
*
+
stack (values)
7
answer =
7
algo
master
.
io
Step:
Shunting-yard: first convert to RPN, then evaluate it.
0 / 18
Input
Example 1
Example 2
Example 3
Custom
s
=
3+2*2
0 / 18
algo
master
.
io
Step:
Shunting-yard: first convert to RPN, then evaluate it.