码迷,mamicode.com
首页 >  
搜索关键字:implement strstr    ( 2381个结果
LeetCode:String to Integer (atoi)
8. String to Integer (atoi) Total Accepted: 91403 Total Submissions: 683692 Difficulty: Easy Implement atoi to convert a string to an integer. Hint: C
分类:其他好文   时间:2016-03-10 21:57:23    阅读次数:251
Leetcode 225 Implement Stack using Queues STL
用两个队列去实现栈,这里我使用了队列数组q[2],在所有的过程中保证一个队列是空的 push时插入到空的队列中,然后将队列中的元素移到另一个队列中 pop时从不空的队列中pop() peek时从不空的队列中取出front() 1 class Stack { 2 public: 3 queue<int
分类:其他好文   时间:2016-03-09 22:22:14    阅读次数:180
Linux GCC下strstr的实现以及一个简单的Kmp算法的接口
今天做了一道题,要用判断一个字符串是否是另一个字符串的子串,于是查了一下strstr的实现。 代码如下: 1 char *strstr(const char*s1,const char*s2) 2 { 3 const char*p=s1; 4 const size_t len=strlen(s2);
分类:编程语言   时间:2016-03-09 17:24:32    阅读次数:283
CAF(C++ actor framework)使用随笔(使用类去构建actor和使用的一些思路)
Class-based actorsA class-based actor is a subtype of event_based_actor and must implement the pure virtual member function make_behavior returning th
分类:编程语言   时间:2016-03-09 10:53:42    阅读次数:171
【转】android: 长按删除listview的item
原文网址:http://www.cnblogs.com/nuistlr/archive/2012/09/07/2675649.html 首先要继承OnItemLongClickListener public class Set_Music extends ListActivity implement
分类:移动开发   时间:2016-03-08 00:22:01    阅读次数:147
lintcode-easy-Sqrt(x)
Implement int sqrt(int x). Compute and return the square root of x. sqrt(3) = 1 sqrt(4) = 2 sqrt(5) = 2 sqrt(10) = 3 mid*mid 以及 (mid + 1) * (mid + 1)都
分类:其他好文   时间:2016-03-07 08:55:58    阅读次数:146
28. Implement strStr()
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. AC代码: class Solution(obj
分类:其他好文   时间:2016-03-07 01:19:29    阅读次数:142
LeetCode(69):Sqrt(x)
Sqrt(x):Implement int sqrt(int x).Compute and return the square root of x. 题意:实现开方函数。 思路:采用二分查找的方式进行,判断。 代码: ublic class Solution { public int mySqrt(...
分类:其他好文   时间:2016-03-06 20:44:48    阅读次数:153
LeetCode 50 Pow(x, n)(Math、Binary Search)(*)
翻译实现pow(x, n).原文Implement pow(x, n).分析首先给大家推荐维基百科:zh.wikipedia.org/wiki/二元搜尋樹 en.wikipedia.org/wiki/Binary_search_tree 其次,大家也可以看看类似的一道题:LeetCode 69 Sqrt(x)(Math、Binary Search)(*) 然而这题我还是没有解出来,看看别人的解法……...
分类:其他好文   时间:2016-03-05 23:52:37    阅读次数:377
LeetCode Zigzag Iterator
原题链接在这里:https://leetcode.com/problems/zigzag-iterator/ 题目: Given two 1d vectors, implement an iterator to return their elements alternately. For examp
分类:其他好文   时间:2016-03-05 01:34:10    阅读次数:227
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!