Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. while ((s=símbolo lido)!=null)
  2. if (s é numero) then
  3. output+=s
  4. else
  5. if (s == “)”) then
  6. while (stack.top()!= “(“)
  7. output += stack.pop()
  8. stack.pop()
  9. else
  10. if (prioridade(s) >prioridade(stack.top()))
  11. stack.push(s)
  12. else
  13. while(stack.top()<>”(“ or
  14. stack.top()>=prioridade(s) )
  15. output+=stack.pop()
  16. stack.push(s)
  17. while (!stack.empty())
  18. output+=stack.pop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement