There are a number of ways to implement Ajax and Comet, and these underlying implementationsare sometimes known as transports.有很多方法可以实现ajax和comet,这些底层...
分类:
Web程序 时间:
2015-03-18 15:47:06
阅读次数:
140
In this example we'll look at how to implement a worker pool using goroutines and channelspackage mainimport ( "fmt" "time")func worker(id int, ...
分类:
其他好文 时间:
2015-03-18 13:57:12
阅读次数:
97
problem:
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entir...
分类:
其他好文 时间:
2015-03-18 12:26:30
阅读次数:
127
1.用法,要传2个参数 stristr(string,search):查找并返还匹配后,剩下的部分字符串 查找过程不区分大小写,要区分大小写用 strstr(string,search)少一个字母i search:要查找的字符。如果该参数是数字,则搜索匹配该数字对应的 ASCII 值的字符。(所以要...
分类:
Web程序 时间:
2015-03-18 12:02:29
阅读次数:
352
在C语言中库函数strstr()函数表示在一个字符串str1中查找另一个字符串str2,如果查到则返回str2在str1中首次出现的位置,如果找不到则返回null。char* strstr(char* str,char* s){ int n; if(*s != '\0'){ while(*st...
分类:
编程语言 时间:
2015-03-18 01:04:00
阅读次数:
201
Basic sends and receives on channels are blocking. However, we can use select with a default clause to implement non-blocking sends, receives, and eve...
分类:
其他好文 时间:
2015-03-17 14:11:05
阅读次数:
189
字符串也是ACM中的重头戏,基本内容有KMP ,扩展KMP, Manacher ,AC自动机,后缀数组,后缀自动机.按照专题来做共分三部分. LCS LIS LCIS不知道算不算....点击打开链接
小技巧:匹配问题不区分大小写,则将其全部转为小写.
暴力匹配: 用strstr函数就能解决 I M N Z(枚举长度 三份)
一.KMP算法
解决单一模式串匹配问题.
利用失配后...
分类:
其他好文 时间:
2015-03-15 12:31:10
阅读次数:
377
strstr strchr strrstrstrtchrstrlen strcpy strcmp strncmp sprintf_s sscanf_s 单字节wcsstr wcschr wcsrstr wcsrchr wcslen wcscpy wcscmp wcsncmp swprintf_s s...
分类:
其他好文 时间:
2015-03-14 20:02:06
阅读次数:
219
Implement pow(x,n).思路:这道题的关键在于 时间。想办法让时间复杂度降低。(但有一点我没想懂,不考虑大小溢出问题么?难道因为是double的原因?待我研究下)解法很巧妙。想了好久,觉得这个解释更合理一点。n = 2k+m ----> xn = (x2)k·xm数n可以拆分成2k+m...
分类:
其他好文 时间:
2015-03-14 18:23:21
阅读次数:
129
Pow(x, n)问题: Implement pow(x,n).思路: 分治法我的代码:public class Solution { public double pow(double x, int n) { return n >= 0 ? helper(x,n) : 1/h...
分类:
其他好文 时间:
2015-03-14 16:54:46
阅读次数:
126