Constructing Lempel-Ziv Codes
Step 1: Parse the input string into comma separated phrases that represent strings that can be represented by a previous string as a prefix + 1 bit.
Step 2: Encode the different phrases (except the last one) using a minimal binary representation. Start with the null phrase.
Step 3: Write the string, listing 1) the code for the prefix phrase + the new bit needed to create the new phrase.