题目:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not poss...
分类:
编程语言 时间:
2016-01-08 00:10:16
阅读次数:
205
Given an Iterator class interface with methods:next()andhasNext(), design and implement a PeekingIterator that support thepeek()operation -- it essent...
分类:
其他好文 时间:
2016-01-07 23:00:20
阅读次数:
428
比较典型的一个题目,easy,不过可以有许多实现方式。这里用的方式是每次pop完成之后再将stack2中的内容立即倒回stack1中。但是其他的实现也可以不是这样,可以是需要push的时候检查再,如果内容在stack2中,这时候将其倒回在进行push。这里采取第一种比较笨的方法,代码如下所示: 1 ...
分类:
其他好文 时间:
2016-01-06 00:06:21
阅读次数:
241
题目用栈实现队列正如标题所述,你需要使用两个栈来实现队列的一些操作。队列应支持push(element),pop() 和 top(),其中pop是弹出队列中的第一个(最前面的)元素。pop和top方法都应该返回第一个元素的值。样例比如push(1), pop(), push(2), push(3),...
分类:
其他好文 时间:
2016-01-05 20:54:36
阅读次数:
245
题目描述: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 fr...
分类:
编程语言 时间:
2016-01-05 15:33:44
阅读次数:
169
31. Next Permutation
My Submissions
Question
Total Accepted: 54346 Total
Submissions: 212155 Difficulty: Medium
Implement next permutation, which rearranges numbers into the lexico...
分类:
其他好文 时间:
2016-01-03 15:17:48
阅读次数:
167
Design and implement a TwoSum class. It should support the following operations:addandfind.add- Add the number to an internal data structure.find- Fin...
分类:
其他好文 时间:
2016-01-01 12:56:33
阅读次数:
192
Implement pow(x,n).public class Solution { public double myPow(double x, int n) { if(n == 0) return 1; if(n<0){ ...
分类:
其他好文 时间:
2015-12-31 07:15:11
阅读次数:
171
//// main.c// homeWork1230////#include #include #include int main(int argc, const char * argv[]) {//// strstr(str1,str2) 函数用于判断字符串str2是否是str1的子串。...
分类:
编程语言 时间:
2015-12-30 19:21:25
阅读次数:
190
Process:Zhaoyang: Implement the Alex 50M model in the Caffe framework.Yandong: The Azure Back end deployment and do some code integration.Fuchen: opti...
分类:
其他好文 时间:
2015-12-26 15:08:51
阅读次数:
144