查找(二)散列表散列表是普通数组概念的推广。因为对普通数组能够直接寻址,使得能在O(1)时间内訪问数组中的任何位置。在散列表中,不是直接把keyword作为数组的下标,而是依据keyword计算出对应的下标。使用散列的查找算法分为两步。第一步是用散列函数将被查找的键转化为数组的一个索引。我们须要面对...
分类:
其他好文 时间:
2014-06-29 00:46:22
阅读次数:
548
1、下载php源码包http://www.php.net/downloads.php2 、安装phptar -xvf php-5.5.13.tar.bz2cd php-5.5.13./configure --prefix=/usr/local/php --with-config-file-path=...
分类:
Web程序 时间:
2014-06-28 11:46:15
阅读次数:
259
insert into prefix_${table_name} (a, b, c) values (#{a}, #{b}, #{c})
${} 表示直接使用字面量(literal value)
#{} 表示这个是个参数
如果 table_name 是 “ABC”
则 ${table_name} 是 ABC
#{table_name} 是 “ABC"...
分类:
数据库 时间:
2014-06-22 00:58:21
阅读次数:
240
监控server端的安装部署一、apache的安装下载httpd-2.2.15.tar.gz gunzip httpd-2.2.15.tar.gztar xvf httpd-2.2.15.tarcd httpd-2.2.15./configure --prefix=/usr/local/apache...
分类:
移动开发 时间:
2014-06-21 07:24:13
阅读次数:
319
/** * $str 原始字符串 * $encoding 原始字符串的编码,默认GBK * $prefix 编码后的前缀,默认"&#" * $postfix 编码后的后缀,默认";" */function unicode_encode($str, $encoding = 'GBK', $prefix...
分类:
Web程序 时间:
2014-06-20 22:26:42
阅读次数:
286
linux下安装最新版subversion,代码:
[root@localhost subversion-1.8.9]#
./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/us...
分类:
系统相关 时间:
2014-06-18 12:19:21
阅读次数:
275
题目
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
软件运行越来越慢,突然在想,是不是因为NSLog,太多的原因。因为自己总是喜欢用NSLog打印出变量,然后,在进行调试程序,找Bug.网上查找资料,果然,和这个还是有点关系的。直接上代码,使其在release下不输出NSLog打印的内容,debug下才输出。要注意,这部分代码是要写在prefix.p...
分类:
其他好文 时间:
2014-06-18 08:58:38
阅读次数:
208
Write a function to find the longest common prefix string amongst an array of strings.题解: 寻找一组字符串的最长公共前缀。最简单的方法,用一个字符串记录当前最长的公共前缀,然后依次比较。时间复杂度: O(N). ...
分类:
其他好文 时间:
2014-06-18 00:03:08
阅读次数:
274
我这里用到的nginx为最新版的nginx所以我使用了最新的插件nginx_upstream_check_module-master.zipcdnginx-1.7.1patch-p1</tmp/nginx_upstream_check_module-master/check_1.5.12+.patchnginx-V./configure--prefix=/usr/local/nginx--with-http_stub_status_module--with-h..
分类:
其他好文 时间:
2014-06-17 17:17:22
阅读次数:
337