c++ Programming Glossary: stack.empty
Convert from an infix expression to postfix (C++) using Stacks http://stackoverflow.com/questions/12684086/convert-from-an-infix-expression-to-postfix-c-using-stacks a comment to the answer from Yuushi. The outer while stack.empty loop is wrong. just remove it. keep the loop body ofc . At the.. if isOperator current char rightOperator current while stack.empty isOperator stack.top precedence stack.top rightOperator postfix.. ' ' current While top of stack is not a left parens while stack.empty ' ' stack.top postfix ' ' stack.top stack.pop if stack.empty..
|