c语言自然是应用最最著名的kmp(看毛片)算法。 这个算法的理解可以参考: https://www.cnblogs.com/yjiyjige/p/3263858.html python: python是真的简单,运用切片就能达到想要的目的了。 ...
分类:
编程语言 时间:
2019-03-08 09:49:26
阅读次数:
185
第一次提交 int strStr(char haystack, char needle) { int length1 = strlen(haystack); int length2 = strlen(needle); int i = 0; int j = 0; int index = 0; int ...
分类:
其他好文 时间:
2019-03-07 22:07:28
阅读次数:
218
[LeetCode 772] Basic Calculator III 基本计算器之三 Implement a basic calculator to evaluate a simple expression string. The expression string may contain ope ...
分类:
其他好文 时间:
2019-03-04 09:55:38
阅读次数:
253
题目: Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 分析: 分 ...
分类:
编程语言 时间:
2019-03-02 00:52:02
阅读次数:
223
在开始代码前要先介绍几个PHP函数: explode() 把字符串打散成数组 strpos() 返回字符串在另一个字符串第一次出现的位置(对大小写敏感) strstr() 查找字符串在另一个字符串的位置,并返回剩余部分(对大小写敏感) substr() 返回字符串的一部分 好了,废话不多说,直接上代 ...
分类:
Web程序 时间:
2019-02-27 20:25:25
阅读次数:
247
50. Pow(x, n) Implement pow(x, n), which calculates x raised to the power n (xn). Example 1: Example 2: Example 3: ...
分类:
Web程序 时间:
2019-02-24 22:56:48
阅读次数:
195
44. Wildcard Matching Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'. The matching shou ...
分类:
Web程序 时间:
2019-02-24 00:52:11
阅读次数:
234
1 首先介绍几个常用到的转义符 (1) 换行符“\n”, ASCII值为10; (2) 回车符“\r”, ASCII值为13; (3) 水平制表符“\t”, ASCII值为 9; (4) 空字符“\0” ,ASCII值为0; (5) 空:NULL (即为0); (6) 空格键space, ASCII ...
分类:
编程语言 时间:
2019-02-21 16:15:22
阅读次数:
164
28. Implement strStr() Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Ex ...
分类:
Web程序 时间:
2019-02-17 22:17:08
阅读次数:
257