You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. If the scanned character is an ‘(‘, push it to the stack.
5
+
3. else If the scanned character is an ‘)’, pop the stack and output it until a ‘(‘ is encountered, discard both '(' and ')'
6
+
4. else If the scanned character is an operand, output it.
7
+
5. Else if it is an operand,
8
+
1 If the precedence of the scanned operator is greater than the precedence of the operator in the stack or the stack is empty or the stack contains a ‘(‘ , push it onto the stack.
9
+
2 Else, Pop all the operators from the stack which are greater than or equal to in precedence than that of the scanned operator until the stack is not empty or '(' is not encountered. After doing that Push the scanned operator to the stack.
10
+
6. Repeat steps 2-6 until infix expression is scanned.
0 commit comments