摘要: 地址:https://leetcode-cn.com/problems/implement-queue-using-stacks/ <?php /** 232. 用栈实现队列 使用栈实现队列的下列操作: push(x) -- 将一个元素放入队列的尾部。 pop() -- 从队列首部移除元素。 pee 阅读全文
posted @ 2020-04-11 16:49 花花妹子。 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/single-number/ <?php /** 给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。 说明: 你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗? 阅读全文
posted @ 2020-04-11 16:17 花花妹子。 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode-cn.com/problems/min-stack/ <?php /** 设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。 push(x) —— 将元素 x 推入栈中。 pop() —— 删除栈顶的元素。 top() —— 阅读全文
posted @ 2020-04-11 16:15 花花妹子。 阅读(136) 评论(0) 推荐(0) 编辑