232.用栈实现队列 力扣题目链接
心得:思路不难,栈和队列的特性要掌握
1)栈,先进后出;队列,先进先出
2)初始化一个栈,Stack<Integer> stack = new Stack<>()
3)放入元素,stack.push()
4)弹出栈顶元素,stack.pop()
5)获取栈顶元素但不弹出,stack.peek()
225.用队列实现栈
标签:第十天,队列,随想录,实现,用栈,225,stack,232 From: https://www.cnblogs.com/camping/p/17110742.html