A sequence is encoded using the LZW algorithm and the initial dictionary shown in Table 1.
Table 1 : Initial dictionary
| Index |
Entry |
| 1 |
a |
| 2 |
b |
| 3 |
h |
| 4 |
i |
| 5 |
s |
| 6 |
t |
(a) The output of the LZW encoder is the following sequence:
| 6 |
3 |
4 |
5 |
2 |
3 |
1 |
6 |
2 |
9 |
11 |
16 |
12 |
14 |
4 |
20 |
10 |
8 |
23 |
13 |
Decode this sequence.
(b) Encode the decoded sequence using the same initial dictionary. Does your answer match the sequence given above?