【发布时间】:2020-03-11 00:19:09
【问题描述】:
我对这个作业和堆栈的数据结构有点困惑。本质上的问题是:
"Give the output printed by java Stack for the input"
下面是输入
it was - the best - of times - - - it was - the - -
输出将在答案键中
was best times of the was the it (1 left on stack)
我不明白您将如何收到此输出我尝试编写自己的堆栈结构,但如果我遍历它,我只会先进先出。
如有任何帮助,我将不胜感激。
【问题讨论】:
标签: data-structures stack