Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using...
分类:
其他好文 时间:
2015-04-26 09:14:50
阅读次数:
108
问题描述:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding ele...
分类:
编程语言 时间:
2015-04-25 22:41:59
阅读次数:
172
问题描述: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 be...
分类:
编程语言 时间:
2015-04-25 14:51:50
阅读次数:
148
Implement strStr()
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
解题思路:
1、暴力法。逐一匹配,然后回溯。代码如下,但是产生超时错误。
class...
分类:
其他好文 时间:
2015-04-24 16:23:48
阅读次数:
86
题目:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not poss...
分类:
其他好文 时间:
2015-04-23 17:17:59
阅读次数:
170
题目:
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entire...
分类:
其他好文 时间:
2015-04-21 22:49:16
阅读次数:
168
https://leetcode.com/problems/powx-n/Implement pow(x,n).解题思路:这种math的题目本来就不擅长,看到题目tag里有binary search,很是疑问,不知道怎么解。直接写网友的思路吧,其实就是递归。对幂数n折半递归,递归结束的条件为n达到0...
分类:
其他好文 时间:
2015-04-21 17:58:31
阅读次数:
116
题目:
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 and ask yourself what are the possible i...
分类:
其他好文 时间:
2015-04-20 15:04:26
阅读次数:
114
Title:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not p...
分类:
其他好文 时间:
2015-04-20 12:52:32
阅读次数:
131
strstr char?*ho_strstr(const?char?*s1,?const?char?*s2)?{
????const?char?*p1,?*p2;
????
????if?(*s2?==?‘\0‘)
????????return?(char?*)s1;
????????
????f...
分类:
其他好文 时间:
2015-04-19 19:51:43
阅读次数:
118