首页 > TAG信息列表 > stackA

leetcode 232. Implement Queue using Stacks 用栈实现队列(简单)

一、题目大意 标签: 栈和队列 https://leetcode.cn/problems/implement-queue-using-stacks 请你仅使用两个栈实现先入先出队列。队列应当支持一般队列支持的所有操作(push、pop、peek、empty): 实现 MyQueue 类: void push(int x) 将元素 x 推到队列的末尾 int pop() 从队列的开头移