码迷,mamicode.com
首页 >  
搜索关键字:implement strstr    ( 2381个结果
LeetCode--Single Number II
Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without usi...
分类:其他好文   时间:2015-01-15 11:03:15    阅读次数:157
[LeetCode][Python]Regular Expression Matching
# -*- coding: utf8 -*-'''https://oj.leetcode.com/problems/regular-expression-matching/Implement regular expression matching with support for '.' and '...
分类:编程语言   时间:2015-01-15 00:11:02    阅读次数:215
Single Number
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 ext...
分类:其他好文   时间:2015-01-14 23:01:20    阅读次数:402
Leetcode:Pow(x, n)
Implement pow(x,n).分析:分治法。代码如下:class Solution {public: double pow(double x, int n) { if(n < 0) return 1.0/power(x, -n); return power(...
分类:其他好文   时间:2015-01-14 22:34:51    阅读次数:137
[C++]LeetCode: 93 Binary Search Tree Iterator (经典题,非递归的中序遍历)
题目: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the next smallest number in the BST. Note:...
分类:编程语言   时间:2015-01-14 18:01:28    阅读次数:182
[LeetCode][Algorithms]String to Integer (atoi)
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'https://oj.leetcode.com/problems/string-to-integer-atoi/Implement atoi to convert a string...
分类:其他好文   时间:2015-01-14 00:36:59    阅读次数:143
strstr()查找函数,strchr(),strrchr(),stristr()/strpos(),strrpos()查找字符串位置
在一个较长的字符串这查找匹配的字符串或字符,其中strstr()和strchr()是完全一样的。例:echo strstr('why always you','you');输出:you如果为:echo strstr('why always you','you');则无输出stristr()函数对大小...
分类:其他好文   时间:2015-01-13 21:23:02    阅读次数:173
LeetCode--Sqrt(x)
Implement int sqrt(int x). Compute and return the square root of x. 二分查找法: class Solution { public: int sqrt(int x) { int high = INT_MAX; int low = 0; while(low...
分类:其他好文   时间:2015-01-12 17:41:51    阅读次数:138
PHP的一些知识点研究(一)
一、 基于PHP实现的webshell攻击 二、 不用或少用else语句 三、 单页面结构(Single-page application) 四、 让搜索引擎抓取ajax的内容 五、 CURL_MULTI_INIT() 六、 PHP strstr()函数 七、 论规范化的重要性 八、 HHVM 九、 PHP源码签名收集器 十、 协同过滤推荐算法...
分类:Web程序   时间:2015-01-12 17:35:43    阅读次数:256
[leetcode] Pow(x, n)
Pow(x, n)Implement pow(x,n).思路:分治算法,2^4=(2^2)*(2^2)。整体的思路就是这样,要注意考虑n为负数的情况。我的做法是在写一个函数计算乘方,原来的函数根据n的正负选择如何调用power函数。开始的时候,没有用tmp保存power(x,n/2)的值,直接写成p...
分类:其他好文   时间:2015-01-12 14:17:00    阅读次数:229
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!