https://oj.leetcode.com/problems/next-permutation/Implement next permutation, which rearranges numbers into the lexicographically next greater permuta...
分类:
其他好文 时间:
2015-03-06 22:06:43
阅读次数:
151
[LeetCode] 028. Implement strStr() (Easy) (C++/Python)...
分类:
编程语言 时间:
2015-03-06 15:58:27
阅读次数:
174
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below ...
分类:
其他好文 时间:
2015-03-05 20:48:00
阅读次数:
156
ProblemDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key)- Ge...
分类:
编程语言 时间:
2015-03-05 18:33:09
阅读次数:
252
OpenGL ES Transformations with Gestures Ricardo Rendon Cepeda on December 10, 2013 TweetGestures: Intuitive, sophisticated and easy to implement!In t....
分类:
移动开发 时间:
2015-03-05 01:33:08
阅读次数:
330
Implement pow(x,n).思路:可以连乘,但会超时,所以使用二分法:注意几点:1 不要写成pow(x, n/2)* pow(x, n/2) 还是会超时,因为还是会计算两遍,直接使用临时变量tmp= pow(x, n/2),然会return tmp*tmp2 注意int 有可能为负数3 注...
分类:
其他好文 时间:
2015-03-04 16:24:40
阅读次数:
119
C#测试代码;代码编译;在没有实现managed exception handling时的运行结果;在初步实现managed exception handling后的运行结果。对应的git提交:Implement basic support for managed exception handlin...
分类:
系统相关 时间:
2015-03-04 12:36:46
阅读次数:
165
题目链接:Pow(x, n)
Implement pow(x, n).
这道题的要求是实现pow(x, n)函数。
求x的n次幂。直接的暴力思路,将x乘以自身n次即可,时间复杂度O(n)。当n非常大时,计算时间过长。
考虑将n转化为二进制数,即n = a0*2^0 + a1*2^1 + a2*2^2 + ... + an*2^n。而求x的n次幂,即为x^n = x^(a0*2^0 + a1...
分类:
其他好文 时间:
2015-03-04 11:09:43
阅读次数:
118
代码:暴力算法 1 class Solution { 2 public: 3 int strStr(char *haystack, char *needle) { 4 if (!*needle) 5 return 0; 6 int al...
分类:
其他好文 时间:
2015-03-03 20:36:40
阅读次数:
113
转:http://handbook.blog.163.com/blog/static/837295522010889212296/类:访问修饰符 修饰符 class 类名称 extends 父类名称 implement 接口名称(访问修饰符与修饰符的位置可以互换)访问修饰符名称说明备注public可...
分类:
编程语言 时间:
2015-03-01 23:38:28
阅读次数:
169