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? c Input file name: tomsawyer.txt Output file name (Enter for tomsawyer.huf): Reading 386501 uncompressed bytes. Compressing ... Wrote 221396 compressed bytes. 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? u Input file name: tomsawyer.huf Output file name (Enter for tomsawyer-out.txt): tomsawyer-out.txt Reading 221396 compressed bytes. Decompressing ... Wrote 386501 decompressed bytes. 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? vs First file name: tomsawyer.txt Second file name: tomsawyer-out.txt Files match! 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? f File name to process: tomsawyer.txt Building encoding tree ... {'u' (117), count=8884} {NOT, count=17240} {'\n' (10), count=8356} {NOT, count=34352} {'s' (115), count=17112} {NOT, count=64800} {'O' (79), count=294} {NOT, count=569} {'K' (75), count=24} {NOT, count=45} {'*' (42), count=4} {NOT, count=6} {EOF (256), count=1} {NOT, count=2} {'&' (38), count=1} {NOT, count=12} {'Q' (81), count=6} {NOT, count=21} {'2' (50), count=9} {NOT, count=77} {']' (93), count=16} {NOT, count=32} {'[' (91), count=16} {NOT, count=141} {')' (41), count=16} {NOT, count=32} {'(' (40), count=16} {NOT, count=64} {'V' (86), count=32} {NOT, count=275} {'C' (67), count=134} {NOT, count=1096} {'P' (80), count=269} {NOT, count=527} {'J' (74), count=258} {NOT, count=2065} {'H' (72), count=969} {NOT, count=3992} {'T' (84), count=1927} {NOT, count=7870} {'.' (46), count=3878} {NOT, count=15328} {'w' (119), count=7458} {NOT, count=30448} {'r' (114), count=15120} {NOT, count=128487} {' ' (32), count=63687} {NOT, count=231498} {'d' (100), count=14641} {NOT, count=28038} {'m' (109), count=6884} {NOT, count=13397} {'g' (103), count=6513} {NOT, count=54934} {'t' (116), count=26896} {NOT, count=103011} {'y' (121), count=6509} {NOT, count=12893} {'M' (77), count=251} {NOT, count=495} {':' (58), count=244} {NOT, count=952} {'?' (63), count=457} {NOT, count=1847} {'R' (82), count=126} {NOT, count=234} {'U' (85), count=57} {NOT, count=108} {'X' (88), count=51} {NOT, count=450} {'Y' (89), count=216} {NOT, count=895} {'B' (66), count=445} {NOT, count=3339} {'I' (73), count=1492} {NOT, count=6384} {'"' (34), count=3045} {NOT, count=25180} {'c' (99), count=6363} {NOT, count=12287} {'f' (102), count=5924} {NOT, count=48077} {'o' (111), count=22897} {NOT, count=386502} {'a' (97), count=22886} {NOT, count=45513} {'l' (108), count=11967} {NOT, count=22627} {'k' (107), count=3001} {NOT, count=5733} {'D' (68), count=208} {NOT, count=401} {'E' (69), count=193} {NOT, count=782} {'j' (106), count=381} {NOT, count=1449} {'G' (71), count=93} {NOT, count=172} {'F' (70), count=79} {NOT, count=343} {'q' (113), count=171} {NOT, count=667} {'N' (78), count=324} {NOT, count=2732} {'!' (33), count=644} {NOT, count=1283} {';' (59), count=639} {NOT, count=10660} {',' (44), count=4927} {NOT, count=83929} {'n' (110), count=19821} {NOT, count=38416} {'h' (104), count=18595} {NOT, count=155004} {''' (39), count=2424} {NOT, count=4821} {'L' (76), count=169} {NOT, count=320} {'z' (122), count=151} {NOT, count=619} {'x' (120), count=299} {NOT, count=1222} {'S' (83), count=603} {NOT, count=2397} {'A' (65), count=591} {NOT, count=1175} {'W' (87), count=584} {NOT, count=9425} {'v' (118), count=2335} {NOT, count=4604} {'-' (45), count=2269} {NOT, count=18349} {'b' (98), count=4513} {NOT, count=8924} {'p' (112), count=4411} {NOT, count=35668} {'i' (105), count=17319} {NOT, count=71075} {'e' (101), count=35407} 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.