Created
January 18, 2018 19:39
-
-
Save Romain-P/f6875cf3c309b9b75c9901f8a885cf32 to your computer and use it in GitHub Desktop.
algo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| else if (is_operator(c)) { | |
| if (operators.empty() || operators.top() == LEFT) { | |
| operators.push(c); | |
| } else { | |
| while (!operators.empty() && | |
| operators.top() != LEFT && | |
| OPS.at(c)._precedence <= OPS.at(operators.top())._precedence) { | |
| operators.pop(); | |
| if (!operators.empty()) | |
| operands.push(operators.top()); | |
| } | |
| operands.push(c); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment