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