免费下载地址在 http://linux.linuxidc.com/
用户名与密码都是www.linuxidc.com
http://www.iteye.com/topic/1073767
http://www.chm-pdf.com/
大型网站架构资料: http://www.danga.com/words/
http://www.blogjava.net/BlueDavy/archive/2008/09/03/226749.html
http://blog.zhangjianfeng.com/article/743
https://asia-ml06.asia.csc.com/mail/tduan.nsf
t3mpD02/02
http://stamen.iteye.com/blog/1535120
http://tech.sina.com.cn/s/s/2012-07-11/08077374771.shtml
samcss: http://smacss.com/book/
public static void sort(int[] datas){
int h=1;
while(h<=datas.length/3){
h=h*3+1;
}
int outer;
int inner;
int tmp;
while(h>0){
for(outer=0;outer<datas.length;outer++){
tmp=datas[outer];
inner=outer;
while(inner>h-1 && datas[inner-h]>tmp){
datas[inner]=datas[inner-h];
inner=inner-h;
}
datas[inner]=tmp;
}
h=(h-1)/3;
}
}
public static void insertSort(int[] datas){
int in, out;
for(out=0;out<datas.length;out++){
int tmp=datas[out];
in=out;
while(in>0 && datas[in-1]>tmp){
datas[in]=datas[in-1];
in--;
}
datas[in]=tmp;
}
}
public void quickSort(DataWrap[ ] data,int start, int end){
if(start<end){
DataWrap base=data[start]; //第一个元素做分界值
int i=start; //i从左边开始,搜索大于分界值的数据
int j=end+1; //j 从右边找小于分界值的
while(true){
while(i<end &&data[++i].compareTo(base)<=0);
while(j>start && data[--j].compareTo(base)>=0);
if(i<j){ swap(data,i, j) }else{ break; }
}
swap(data,start,j); //分界值放到中间位置
quickSort(data,start,j-1);
quickSort(data,j+1,end);
}
public static void createKey(String partner){
int[] next=new int[partner.length()];
next[0]=-1; int index;
for(int i=1;i<partner.length();i++){
index=next[i-1];
while(index>=0 &&partner.charAt(i)!=partner.charAt(index+1)){
index=next[index];
}
if(partner.charAt(i)==partner.charAt(index+1)){
next[i]=index+1;
}else{
next[i]=-1;
}
}
public static int match(String str,String partner){
int t_size=str.length();
int p_size=partner.length();
int[] next=createKey(partner);
int t_index=0, p_index=0;
while(p_index<p_size && t_index<t_size){
if(str.charAt(t_index)==partner.charAt(p_index)){
++t_index;
++p_index;
}else if(p_index==0){
++t_index;
}else{
p_index=next[p_index-1]+1;
}
}
if(p_index==p_size){
return t_index-p_index;
}else{
return -1;
}
}
http://ouyangjia7.iteye.com/blog/352954
http://www.cnblogs.com/lua5/archive/2010/12/04/1895968.html