| Algorithm 2 LZW Pseudocode |
| initialize Dictionary[0-255] = first 256 ASCII codes STRING ← get input symbol while there are still input symbols do SYMBOL ← get input symbol if (STRING+SYMBOL is in Dictonary) then STRING = STRING+SYMBOL else output the code for STRING add STRING+SYMBOL to Dictionary STRING = SYMBOL end if end while output the code for STRING |