码迷,mamicode.com
首页 >  
搜索关键字:implement strstr    ( 2381个结果
[cc150] check palindrome of a singly linked list
Problem: Implement a function to check if a singly linked list is a palindrome.思路:最简单的方法是 Reverse and compare.另外一种非常经典的办法是用 Recursive 的思路,把一个list看成这种形...
分类:其他好文   时间:2014-07-16 17:41:23    阅读次数:188
Validating Receipts Locally
Validating Receipts Locally Perform receipt validation immediately after your app is launched, before displaying any user interface or spawning any child processes. Implement this check in the ma...
分类:其他好文   时间:2014-07-16 11:48:20    阅读次数:267
POJ 3461 Oulipo KMP算法题解
本题就是给出很多对字符串,然后问一个字符串在另外一个字符串出现的次数。 就是所谓的Strstr函数啦。 Leetcode有这道几乎一模一样的题目。 使用KMP算法加速,算法高手必会的算法了。 另外看见讨论说什么使用KMP还超时,最大可能是没有真正理解next table的含义,写了错误的代码,故此虽然自己运行结果正确,但是却没有真正发挥next table的作用,使得算法退化为暴力法了,所...
分类:其他好文   时间:2014-07-13 18:41:48    阅读次数:229
LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu...
分类:其他好文   时间:2014-07-11 20:36:27    阅读次数:234
CTCI 3.1
Describe how you could use a single array to implement three stacks.Divide the array into three fixed parts, each stands for a stack./*Fixed Size Stac...
分类:其他好文   时间:2014-07-11 10:45:34    阅读次数:189
CTCI 2.6
Given a circular linked list, implement an algorithm which returns the node at the beginning of the loop.DEFINITIONCircular linked list: A (corrupt) l...
分类:其他好文   时间:2014-07-09 15:24:22    阅读次数:203
android录制视屏(预览,倒计时)
android用mediarecord录制视屏,可以设置视屏格式,大小,还有拍摄前预览,倒计时功能要自己用hander做。 1,CameraPreview.java//预览classpublic class CameraPreview extends SurfaceView implement...
分类:移动开发   时间:2014-07-08 23:57:11    阅读次数:494
[leetcode] LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
分类:其他好文   时间:2014-07-08 22:54:28    阅读次数:287
Cracking the Coding Interview Q2.6
Given a circular linked list, implement an algorithm which returns node at the beginning of the loop.DEFINITIONCircular linked list: A (corrupt) linke...
分类:其他好文   时间:2014-07-08 17:29:35    阅读次数:200
LeetCode——String to Integer (atoi)
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 input ca...
分类:其他好文   时间:2014-07-08 12:52:05    阅读次数:200
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!