参考书《数据压缩导论(第4版)》 Page 121
序列输出<0,0,3>r<0,0,1>ra<0,0,4>rat<2,8,2>ratatatatatb<3,1,2>ratatatatatbab<0,0,3>ratatatatatbabr<6,4,4>ratatatatatbabratbat<9,5,4>ratatatatatbabratbatbabrat
(2)由于窗口的大小为20,先行缓冲区的大小为10,所以编码如下:
输入ratatatatatbabratbatbabrat
输入 | 输出 |
||ratatatatatbabratbatbabrat | <0,0,3> |
|r|atatatatatbabratbatbabrat | <0,0,1> |
|ra|tatatatatbabratbatbabrat | <0,0,4> |
|rat|atatatatbabratbatbabrat | <2,8,2> |
ra|tatatatatb|abratbatbabrat | <3,1,2> |
rata|tatatatbab|ratbatbabrat | <0,0,3> |
ratat|atatatbabr|atbatbabrat | <6,4,4> |
ratatatata|tbabratbat|babrat | <9,5,4> |
4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _(空格) |
3 | I |
4 | T |
5 | H |
解码的序列为:T
2)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | (空格) |
3 | I |
4 | T |
5 | H |
解码的序列为:TH
3)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _(空格) |
3 | I |
4 | T |
5 | H |
6 | TH |
解码的序列为:THI
4)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _ (空格) |
3 | I |
4 | T |
5 | H |
6 | TH |
7 | HI |
解码的序列为:THIS
5)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _ (空格) |
3 | I |
4 | T |
5 | H |
6 | TH |
7 | HI |
8 | IS |
解码的序列为:THIS_
6)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _ (空格) |
3 | I |
4 | T |
5 | H |
6 | TH |
7 | HI |
8 | IS |
9 | S_ |
解码的序列为:THIS IS
7)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _ (空格) |
3 | I |
4 | T |
5 | H |
6 | TH |
7 | HI |
8 | IS |
9 | S_ |
10 | _I |
解码的序列为:THIS IS_
8)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _ (空格) |
3 | I |
4 | T |
5 | H |
6 | TH |
7 | HI |
8 | IS |
9 | S_ |
10 | _I |
11 | IS_ |
解码的序列为:THIS IS HI
9)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _ (空格) |
3 | I |
4 | T |
5 | H |
6 | TH |
7 | HI |
8 | IS |
9 | S_ |
10 | _I |
11 | IS_ |
12 | _H |
解码的序列为:THIS IS HIS
10)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _ (空格) |
3 | I |
4 | T |
5 | H |
6 | TH |
7 | HI |
8 | IS |
9 | S_ |
10 | _I |
11 | IS_ |
12 | _H |
13 | HIS |
解码的序列为:THIS IS HIS HI
11)输入4,5,3,1,2,8,2,7,9,7,4
索引 | 条目 |
1 | S |
2 | _ (空格) |
3 | I |
4 | T |
5 | H |
6 | TH |
7 | HI |
8 | IS |
9 | S_ |
10 | _I |
11 | IS_ |
12 | _H |
13 | HIS |
14 | S_H |
解码的序列为:THIS IS HIS HIT
综上可得:解码的序列为THIS IS HIS HIT。