1.对字符串进行hash大家可以看一下, SHA1 HashesGo by Example写道:The pattern for generating a hash is sha1.New(), sha1.Write(bytes), then sha1.Sum([]byte{}). 附上golang代...
分类:
其他好文 时间:
2014-06-18 16:07:48
阅读次数:
294
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an...
分类:
其他好文 时间:
2014-06-18 12:32:58
阅读次数:
169
题目
Write a function to find the longest common prefix string amongst an array of strings.
方法
从第一个字符开始,判断是否相同。
public String longestCommonPrefix(String[] strs) {
if (strs ...
分类:
其他好文 时间:
2014-06-18 11:18:30
阅读次数:
205
Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))...
分类:
其他好文 时间:
2014-06-18 11:15:22
阅读次数:
149
头文件unistd.h是Linux/Unix的系统调用,包含了许多UNIX系统服务函数原型,如open、read、write、_exit、getpid等函数。在linux下能够编译通过的包含此头文件的程序,在VC下编译时出现了如下问题 fatal error C1083: Cannot open i...
分类:
其他好文 时间:
2014-06-18 10:31:54
阅读次数:
244
题目
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()...
分类:
其他好文 时间:
2014-06-17 22:59:06
阅读次数:
223
??
var d=new Date();
document.write("从 1991/02/02 至今已过去 " + d.getTime() + " 毫秒");
从 1991/02/02 至今已过去 1402917686044 毫秒...
分类:
其他好文 时间:
2014-06-17 22:46:57
阅读次数:
235
android.permission.ACCESS_CHECKIN_PROPERTIES 允许读写访问"properties"表在checkin数据库中,改值可以修改上传( Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded)
...
分类:
移动开发 时间:
2014-06-17 21:58:57
阅读次数:
437
4.4 使用递归算法计算阶乘
function calc(n){
if(n>0) return(calc(n-1)*n);
return(1);
}
document.write("正整数8的阶乘是"+calc(8));
document.write("正整数16的阶乘是"+calc(16));...
分类:
编程语言 时间:
2014-06-17 16:14:39
阅读次数:
301
只需要对word遍历一遍即可 int write(string word) { int cnt = 0; for(int i = 0 ; i < word.length(); ++ i){ cnt+=word[i]-'A'+1; ...
分类:
其他好文 时间:
2014-06-17 14:01:50
阅读次数:
206