【发布时间】:2013-07-12 07:24:33
【问题描述】:
美好的一天!我正在使用堆栈实现中缀到后缀转换器。当用户输入不带括号的中缀表达式时,它起作用;但是当有括号时,控制台会说:
Exception in thread "main" StackEmptyException: Stack is empty.
at ArrayStack.top(ArrayStack.java:85)
at InfixToPostfix.convert(InfixToPostfix.java:54)
at InfixToPostfix.main(InfixToPostfix.java:85)
我的问题是实现排名(堆栈顶部)。
【问题讨论】:
标签: java stack postfix-notation infix-notation