|  | Input | Output | Comment |  | 
 | 
 | 
 |  | a | 0a |  |  | b | 0b |  |  | a |  |  |  | b | 1b |  |  | c | 0c |  |  | b |  |  |  | a | 2a |  |  | b |  |  |  | a |  |  |  | b | 5b |  |  | a |  |  |  | a | 1a |  |  | a |  |  |  | a |  |  |  | a | 7a |  |  | a |  |  |  | a |  |  |  | a |  |  |  | a | 8a |  |  |  | 
 |  
| .
        While the input is not exhausted:
              
      next input symbol. If  is found in the dictionary, then:
                    
         address of  in the dictionary.
Else:
                    Output .
                    Insert 
                 in the dictionary. .
 |  |  | Address |  |  | String |  | 
 | 
 | 
 | 
 |  | 1 | 0 | a | a |  | 2 | 0 | b | b |  | 3 | 1 | b | ab |  | 4 | 0 | c | c |  | 5 | 2 | a | ba |  | 6 | 5 | b | bab |  | 7 | 1 | a | aa |  | 8 | 7 | a | aaa |  | 9 | 8 | a | aaaa | 
 | 
 |