摘要: 使用队列实现栈的下列操作: push(x) -- 元素 x 入栈pop() -- 移除栈顶元素top() -- 获取栈顶元素empty() -- 返回栈是否为空 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/implement-stack-us 阅读全文
posted @ 2019-07-12 00:57 往南的小燕子 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 使用栈实现队列的下列操作: push(x) -- 将一个元素放入队列的尾部。pop() -- 从队列首部移除元素。peek() -- 返回队列首部的元素。empty() -- 返回队列是否为空。 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/i 阅读全文
posted @ 2019-07-12 00:28 往南的小燕子 阅读(169) 评论(0) 推荐(0) 编辑