Created
October 8, 2014 23:55
-
-
Save alexandervasyuk/e66117d0ba1ff9408bc7 to your computer and use it in GitHub Desktop.
parenthesis functionality infix binary tree
This file contains 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
if (token == '(') { | |
operatorStack.push(token); | |
} else if (token == ')') { | |
while(operatorStack.peek() != '(') { | |
var subtree = createSubtree(operatorStack.pop(), null); | |
outputStack.push(subtree); | |
} | |
operatorStack.pop(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment