01 02 03 04 05 06 07 08 09 10 11 12 13 | Compress(n,p,s,l,b) for i <- 1 to n b <- length(p); //length:log(p) bmax <- b; s <- s[i-1] + bmax; l <- 1; for j <- 2 to i and Lmax //Lmax=256 if bmax < b[i-j+1] then bmax <- b[i-j+1]; if s > s[i-j] + j * bmax then s <- s[i-j] +j*bmax; l <- j; s <- s + header; //header=11 |
1 2 3 4 | for i <- 1 to n ... for j <- 2 to i and Lmax //Lmax=256 ... |
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 | declaration B[n] // global Compress(n,p,s,l,b) for i <- 1 to n b <- length(p); //length:log(p) bmax <- b; B <- b; s <- s[i-1] + bmax; l <- 1; for j <- 2 to i and Lmax //Lmax=256 if bmax < b[i-j+1] then bmax <- b[i-j+1]; if s > s[i-j] + j * bmax then s <- s[i-j] +j*bmax; l <- j; for k<- i-j+1 to i B<-bmax; s <- s + header; //header=11 |
歡迎光臨 (http://www.raoushi.com/bbs/) | Powered by Discuz! X3.1 |