Welcome to CS 106B/X Shrink-It! This program uses the Huffman coding algorithm for compression. Any file can be compressed by this method, often with substantial savings. Decompression will faithfully reproduce the original. B)uild enc.tree C)ompress VB) View binary E)ncode data U)ncompress VT) View text D)ecode data F)ree tree VS) View side-by-side Q)uit Your choice? b Read from a s)tring or f)ile? s Type the string to process: ab ab cab Building encoding tree ... {'b' (98), count=3} {NOT, count=6} {'a' (97), count=3} {NOT, count=10} {EOF (256), count=1} {NOT, count=2} {'c' (99), count=1} {NOT, count=4} {' ' (32), count=2} B)uild enc.tree C)ompress VB) View binary E)ncode data U)ncompress VT) View text D)ecode data F)ree tree VS) View side-by-side Q)uit Your choice? e Reuse your previous string/file data for encoding? y Encoding data ... Here is the binary encoded data (3 bytes): 10110010 11000101 01101100 B)uild enc.tree C)ompress VB) View binary E)ncode data U)ncompress VT) View text D)ecode data F)ree tree VS) View side-by-side Q)uit Your choice? d Read from a s)tring or f)ile? s Type the string to process: 10110010 11000101 01101100 Decoding data ... Here is the decoded data (9 bytes): ab ab cab B)uild enc.tree C)ompress VB) View binary E)ncode data U)ncompress VT) View text D)ecode data F)ree tree VS) View side-by-side Q)uit Your choice? b Read from a s)tring or f)ile? s Type the string to process: happy hip hop Building encoding tree ... {'y' (121), count=1} {NOT, count=2} {'o' (111), count=1} {NOT, count=4} {'i' (105), count=1} {NOT, count=2} {'a' (97), count=1} {NOT, count=8} {'p' (112), count=4} {NOT, count=14} {' ' (32), count=2} {NOT, count=3} {EOF (256), count=1} {NOT, count=6} {'h' (104), count=3} B)uild enc.tree C)ompress VB) View binary E)ncode data U)ncompress VT) View text D)ecode data F)ree tree VS) View side-by-side Q)uit Your choice? e Reuse your previous string/file data for encoding? y Encoding data ... Here is the binary encoded data (5 bytes): 00110010 10111101 10011011 00110011 10100100 B)uild enc.tree C)ompress VB) View binary E)ncode data U)ncompress VT) View text D)ecode data F)ree tree VS) View side-by-side Q)uit Your choice? e Reuse your previous string/file data for encoding? n Read from a s)tring or f)ile? s Type the string to process: hippy happy hoppy Encoding data ... Here is the binary encoded data (7 bytes): 00110110 10111101 10011001 01011110 11001110 10101111 01000000 B)uild enc.tree C)ompress VB) View binary E)ncode data U)ncompress VT) View text D)ecode data F)ree tree VS) View side-by-side Q)uit Your choice? d Read from a s)tring or f)ile? s Type the string to process: 00 1101 10 10 1110 011 00 1101 10 10 1110 010 Decoding data ... Here is the decoded data (11 bytes): hippo hippo B)uild enc.tree C)ompress VB) View binary E)ncode data U)ncompress VT) View text D)ecode data F)ree tree VS) View side-by-side Q)uit Your choice? q Exiting.