[1] initialize string table;
[2] get first code: <code>;
[3] output the string for <code> to the charstream;
[4] <old> = <code>;
[5] <code> <- next code in codestream;
[6] does <code> exist in the string table?
(yes:
output the string for <code> to the charstream;
[...] <- translation for <old>;
k <- first character of translation for <code>;
add [...]k to the string table;
<old> <- <code>;
)
(no:
[...] <- translation for <old>;
k <- first character of [...];
output [...]k to charstream and add it to string table;
<old> <- <code>
)
[7] go to [5];