Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front ...
分类:
编程语言 时间:
2016-05-02 21:15:16
阅读次数:
138
源码补码反码数组定义,初始化,使用,随机数找最大数,逆置,冒泡排序,scanf输入字符串字符串处理字符串溢出等问题scanf()gets()puts()fputs()strlen()strcat()strncat()strcmp()strncmp()strchr()strstr()strtok()atoi()atof()atol()C字符串数组定义数组遍历输出数组每个元..
分类:
编程语言 时间:
2016-05-02 17:13:35
阅读次数:
450
题目来源:http://www.lintcode.com/zh-cn/problem/strstr/ 这道题注意边界条件,提交了三次才通过。 1字符串是否为NULL 2source为NULL,target不为NULL,返回0,而不是-1 采用的方法是最简单的朴素模板匹配算法。 可以accept的程序 ...
分类:
其他好文 时间:
2016-05-01 17:27:40
阅读次数:
200
一天一道LeetCode系列(一)题目
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
(二)解题第一种解法:朴素匹配算法
/*两个指针,分别指向两个字符串的首字符如果相等则一起向后移...
分类:
其他好文 时间:
2016-04-29 18:15:10
阅读次数:
192
一天一道LeetCode系列(一)题目
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such arrangement is not possible, it must rearrange it...
分类:
其他好文 时间:
2016-04-29 16:45:18
阅读次数:
138
题目:
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.翻译:
实现一个方法strStr()。返回字符串needle第一次在字符串haystack出现的下标,如果needle不是haysta...
分类:
其他好文 时间:
2016-04-29 15:39:54
阅读次数:
122
1)暴力法O(m+n) 2)KMP、Boyer_Mooer、Rabin_Rarp 暴力法 int strStr(String haystack, String needle){ if ( needle.empty() ) return 0; if ( haystack.size() -1 && pa... ...
分类:
编程语言 时间:
2016-04-27 22:36:22
阅读次数:
258
我今天写程序的时候遇到的问题,开始完成功能后没发觉。当再次部署程序更新时候,出的错误,通过firebug发现提示是TypeError: 'stepUp' called on an object that does not implement interface HTMLInputElement. 注 ...
分类:
Web程序 时间:
2016-04-27 18:37:36
阅读次数:
248
Implement automatic deployment through windows task. ...
分类:
其他好文 时间:
2016-04-27 12:42:21
阅读次数:
117