加载中
使用栈实现队列 Implement Queue using Stacks

问题: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front of queue. peek() --...

2017/08/18 11:09
11
实现迭代器 Peeking Iterator

问题: Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it essentially peek() at...

2017/12/19 14:34
7
栈的压入弹出序列

问题: 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序。假设压入栈的所有数字均不相等。例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈...

2018/03/08 10:12
25
保存最小值得栈 Min Stack

问题: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Removes the element on to...

2017/08/16 16:34
11

没有更多内容

加载失败,请刷新页面

没有更多内容

返回顶部
顶部