栈底在两端:
最底部top[0]改为top[1]
必须把s1栈的元素全部倒入s2,再出栈,才能模拟队列,否则不行:
出队顺序不等于入队顺序
Last updated 6 years ago
Was this helpful?