1: wget
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gztar -zxvf
libiconv-1.13.1.tar.gzcd libiconv-1.13.1./configure --prefix=/usr/local/li...
分类:
Web程序 时间:
2014-06-16 09:44:08
阅读次数:
223
1. trie树,又名字典树,顾名思义,它是可以用来作字符串查找的数据结构,它的查找效率比散列表还要高。
trie树的建树:
比如有字符串”ab” ,“adb”,“adc” 可以建立字典树如图:
树的根节点head不存储信息,它有26个next指针,分别对应着字符a,b,c等。插入字符串ab时,next[‘a’-‘a’]即next[0]为空,这...
分类:
其他好文 时间:
2014-06-14 14:25:50
阅读次数:
406
编译参数:
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --enable-shared --with-libxml-dir --with-gd --with-openssl --enable-mbstring --wit...
分类:
Web程序 时间:
2014-06-14 09:13:09
阅读次数:
245
一、安装apache1.安装pcre./configure
--prefix=$安装路径/pcre3.安装apr & apr-util将apr-1.4.6 与apr-util-1.4.1 更名为apr
和apr-util, 放在./httpd-2.4.2/srclib/下2.安装apache(htt...
分类:
其他好文 时间:
2014-06-12 17:58:16
阅读次数:
298
1.在ApplicationContext-mvc.xml,即是里面有装备以下内容的xml:Java代码
保藏代码class="org.springframework.web.servlet.view.InternalResourceViewResolver">
"prefix" value...
分类:
编程语言 时间:
2014-06-12 15:43:15
阅读次数:
295
其实做起来会感觉很简单,需要注意的是要考虑效率的问题,毕竟可能是很长的字符串数组,所以可以考虑选取所有字符串中最短的那个来首先进行比较,因为最长公共子串肯定不会大于其长度,这样避免了字符串之间长度差异很大造成的效率损失,然后每次比较之后最长公共子串的长度也永远不会大于最短的那个字符串,只会不变或相等,只要遍历字符串数组,挨个对比、更改最短公共字符串记录即可,code如下:...
分类:
其他好文 时间:
2014-06-11 06:58:55
阅读次数:
226
原题地址:https://oj.leetcode.com/problems/longest-common-prefix/题意:Write
a function to find the longest common prefix string amongst an array of
strings.解...
分类:
编程语言 时间:
2014-06-10 16:31:52
阅读次数:
261
题目描述:
Write a function to find the longest common prefix string amongst an
array of strings.
很简单的一道题目,但是我写了两个不一样的版本,运行时间确实数倍之差。。贴代码如下:
版本1:
{CSDN:CODE:384511}
这个版本的运行时间为 44 ms...
分类:
其他好文 时间:
2014-06-10 08:18:58
阅读次数:
291