mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 11:34:46 +08:00
Update 0225.用队列实现栈.md
This commit is contained in:
@ -112,7 +112,7 @@ public:
|
||||
|
||||
# 优化
|
||||
|
||||
其实这道题目就是用一个队里就够了。
|
||||
其实这道题目就是用一个队列就够了。
|
||||
|
||||
**一个队列在模拟栈弹出元素的时候只要将队列头部的元素(除了最后一个元素外) 重新添加到队列尾部,此时在去弹出元素就是栈的顺序了。**
|
||||
|
||||
|
Reference in New Issue
Block a user