Skip to main content
  1. Tags/

2017

用两个栈实现队列

·1 min
思路: 一个元素入队的时候直接插入到stack1中。。。 一个元素出队的时候。。。如果stack2不为空。。stack2顶的元素就是要出队的。。

2016