diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-12-01 15:25:23 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-12-01 15:25:23 +0100 |
| commit | 93c6b29368d1e0487937b433bc6e678da0058055 (patch) | |
| tree | 5e749adfecf2eab82b5e78bbeacc52fc8e2298fb /labb6/res/output | |
| parent | d4f35cf45ebc655d92cde8abb5c9a1c2822a08ba (diff) | |
| download | tddd86-93c6b29368d1e0487937b433bc6e678da0058055.tar.gz | |
given code l6
Diffstat (limited to 'labb6/res/output')
| -rwxr-xr-x | labb6/res/output/expected-output-1.txt | 298 | ||||
| -rwxr-xr-x | labb6/res/output/expected-output-2.txt | 239 | ||||
| -rwxr-xr-x | labb6/res/output/expected-output-3.txt | 572 | ||||
| -rwxr-xr-x | labb6/res/output/expected-output-4.txt | 135 | ||||
| -rwxr-xr-x | labb6/res/output/expected-output-5.txt | 428 | ||||
| -rwxr-xr-x | labb6/res/output/expected-output-6.txt | 424 | ||||
| -rwxr-xr-x | labb6/res/output/expected-output-7.txt | 1300 | ||||
| -rwxr-xr-x | labb6/res/output/expected-output-8.txt | 189 |
8 files changed, 3585 insertions, 0 deletions
diff --git a/labb6/res/output/expected-output-1.txt b/labb6/res/output/expected-output-1.txt new file mode 100755 index 0000000..43087a6 --- /dev/null +++ b/labb6/res/output/expected-output-1.txt @@ -0,0 +1,298 @@ +Welcome to TDDD86 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. + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 1 +Read from a s)tring or f)ile? s +Type the string to process: ab ab cab +Building frequency table ... + 32: ' ' => 2 + 97: 'a' => 3 + 98: 'b' => 3 + 99: 'c' => 1 + 256: EOF => 1 +5 character frequencies found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 2 +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} + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 3 +Building encoding map ... + 32: ' ' => 00 + 97: 'a' => 10 + 98: 'b' => 11 + 99: 'c' => 010 + 256: EOF => 011 +5 character encodings found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 4 +Reuse your previous string/file data for encoding? y +Encoding data ... +Here is the binary encoded data (3 bytes): +10110010 11000101 01101100 + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 5 +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 + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 1 +Read from a s)tring or f)ile? s +Type the string to process: happy hip hop +Building frequency table ... + 32: ' ' => 2 + 97: 'a' => 1 + 104: 'h' => 3 + 105: 'i' => 1 + 111: 'o' => 1 + 112: 'p' => 4 + 121: 'y' => 1 + 256: EOF => 1 +8 character frequencies found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 2 +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} + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 3 +Building encoding map ... + 32: ' ' => 011 + 97: 'a' => 1100 + 104: 'h' => 00 + 105: 'i' => 1101 + 111: 'o' => 1110 + 112: 'p' => 10 + 121: 'y' => 1111 + 256: EOF => 010 +8 character encodings found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 4 +Reuse your previous string/file data for encoding? y +Encoding data ... +Here is the binary encoded data (5 bytes): +00110010 10111101 10011011 00110011 10100100 + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 4 +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 + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 5 +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 + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? q +Exiting. diff --git a/labb6/res/output/expected-output-2.txt b/labb6/res/output/expected-output-2.txt new file mode 100755 index 0000000..406b680 --- /dev/null +++ b/labb6/res/output/expected-output-2.txt @@ -0,0 +1,239 @@ +Welcome to TDDD86 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. + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 1 +Read from a s)tring or f)ile? f +File name to process: short.txt +Building frequency table ... + 10: '\n' => 2 + 32: ' ' => 22 + 97: 'a' => 7 + 99: 'c' => 6 + 100: 'd' => 5 + 101: 'e' => 15 + 102: 'f' => 3 + 104: 'h' => 4 + 105: 'i' => 6 + 108: 'l' => 6 + 109: 'm' => 1 + 110: 'n' => 6 + 111: 'o' => 10 + 112: 'p' => 4 + 114: 'r' => 7 + 115: 's' => 10 + 116: 't' => 10 + 117: 'u' => 3 + 119: 'w' => 1 + 121: 'y' => 3 + 256: EOF => 1 +21 character frequencies found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 2 +Building encoding tree ... + {' ' (32), count=22} + {NOT, count=43} + {'c' (99), count=6} + {NOT, count=11} + {'f' (102), count=3} + {NOT, count=5} + {'w' (119), count=1} + {NOT, count=2} + {'m' (109), count=1} + {NOT, count=21} + {'t' (116), count=10} + {NOT, count=79} + {'s' (115), count=10} + {NOT, count=20} + {'o' (111), count=10} + {NOT, count=36} + {'d' (100), count=5} + {NOT, count=9} + {'p' (112), count=4} + {NOT, count=16} + {'h' (104), count=4} + {NOT, count=7} + {'\n' (10), count=2} + {NOT, count=3} + {EOF (256), count=1} +{NOT, count=132} + {'e' (101), count=15} + {NOT, count=29} + {'r' (114), count=7} + {NOT, count=14} + {'a' (97), count=7} + {NOT, count=53} + {'y' (121), count=3} + {NOT, count=6} + {'u' (117), count=3} + {NOT, count=12} + {'n' (110), count=6} + {NOT, count=24} + {'l' (108), count=6} + {NOT, count=12} + {'i' (105), count=6} + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 3 +Building encoding map ... + 10: '\n' => 100001 + 32: ' ' => 111 + 97: 'a' => 0100 + 99: 'c' => 11011 + 100: 'd' => 10011 + 101: 'e' => 011 + 102: 'f' => 110101 + 104: 'h' => 10001 + 105: 'i' => 0000 + 108: 'l' => 0001 + 109: 'm' => 1101000 + 110: 'n' => 0010 + 111: 'o' => 1010 + 112: 'p' => 10010 + 114: 'r' => 0101 + 115: 's' => 1011 + 116: 't' => 1100 + 117: 'u' => 00110 + 119: 'w' => 1101001 + 121: 'y' => 00111 + 256: EOF => 100000 +21 character encodings found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 4 +Reuse your previous string/file data for encoding? y +Encoding data ... +Here is the binary encoded data (67 bytes): +11001000 10000101 11110000 10111110 10011110 11100011 01001011 10011100 +00001010 01000110 11001111 10101000 00001011 11111011 10101101 00010010 +10101011 01110011 11101100 10110000 00010101 10001001 11111101 01101011 +11101110 01001001 10110111 01111101 00001010 01111100 01101011 01001011 +01011101 10100101 10111110 00101111 00110001 10101101 11000010 10000101 +00111110 11001010 01111110 10110101 11100010 00000100 11111110 11100010 +10001010 10011011 11000110 10110111 11110010 10111100 01011000 11001011 +10011110 10001101 11110001 11011110 01110011 11010001 10010111 11101110 +10100110 11100001 10000000 + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 5 +Read from a s)tring or f)ile? s +Type the string to process: 100010110001000110101111100100010110101011100000 +Decoding data ... +Here is the decoded data (11 bytes): +hello there + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 5 +Read from a s)tring or f)ile? s +Type the string to process: 11001000100001011111000010111110100111101110001101001011100111000000101001000110110011111010100000001011111110111010110100010010101010110111001111101100101100000001010110001001111111010110101111101110010010011011011101111101000010100111110001101011010010110101110110100101101111100010111100110001101011011100001010000101001111101100101001111110101101011110001000000100111111101110001010001010100110111100011010110111111100101011110001011000110010111001111010001101111100011101111001110011110100011001011111101110101001101110000110000000 +Decoding data ... +Here is the decoded data (131 bytes): +this is a short input file composed entirely of spaces and lowercase letters +and end of line characters to help you test your code + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? q +Exiting. diff --git a/labb6/res/output/expected-output-3.txt b/labb6/res/output/expected-output-3.txt new file mode 100755 index 0000000..ff89f76 --- /dev/null +++ b/labb6/res/output/expected-output-3.txt @@ -0,0 +1,572 @@ +Welcome to TDDD86 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. + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 1 +Read from a s)tring or f)ile? f +File name to process: medium.txt +Building frequency table ... + 10: '\n' => 9 + 13: '\r' => 9 + 32: ' ' => 502 + 34: '"' => 8 + 39: ''' => 4 + 40: '(' => 3 + 41: ')' => 5 + 44: ',' => 36 + 45: '-' => 7 + 46: '.' => 27 + 48: '0' => 2 + 50: '2' => 1 + 52: '4' => 1 + 58: ':' => 2 + 65: 'A' => 3 + 66: 'B' => 2 + 67: 'C' => 3 + 68: 'D' => 3 + 70: 'F' => 2 + 71: 'G' => 2 + 72: 'H' => 1 + 73: 'I' => 4 + 75: 'K' => 1 + 77: 'M' => 1 + 79: 'O' => 5 + 80: 'P' => 3 + 82: 'R' => 3 + 83: 'S' => 4 + 84: 'T' => 15 + 87: 'W' => 3 + 97: 'a' => 188 + 98: 'b' => 28 + 99: 'c' => 89 + 100: 'd' => 82 + 101: 'e' => 300 + 102: 'f' => 53 + 103: 'g' => 55 + 104: 'h' => 89 + 105: 'i' => 210 + 106: 'j' => 1 + 107: 'k' => 10 + 108: 'l' => 102 + 109: 'm' => 57 + 110: 'n' => 205 + 111: 'o' => 213 + 112: 'p' => 59 + 113: 'q' => 2 + 114: 'r' => 187 + 115: 's' => 182 + 116: 't' => 220 + 117: 'u' => 77 + 118: 'v' => 36 + 119: 'w' => 34 + 120: 'x' => 1 + 121: 'y' => 59 + 122: 'z' => 2 + 256: EOF => 1 +57 character frequencies found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 2 +Building encoding tree ... + {' ' (32), count=502} + {NOT, count=981} + {'v' (118), count=36} + {NOT, count=72} + {',' (44), count=36} + {NOT, count=138} + {'w' (119), count=34} + {NOT, count=66} + {'j' (106), count=1} + {NOT, count=2} + {'M' (77), count=1} + {NOT, count=4} + {'K' (75), count=1} + {NOT, count=2} + {'H' (72), count=1} + {NOT, count=8} + {'4' (52), count=1} + {NOT, count=2} + {'2' (50), count=1} + {NOT, count=4} + {'z' (122), count=2} + {NOT, count=16} + {'q' (113), count=2} + {NOT, count=4} + {'G' (71), count=2} + {NOT, count=8} + {'F' (70), count=2} + {NOT, count=4} + {'B' (66), count=2} + {NOT, count=32} + {':' (58), count=2} + {NOT, count=4} + {'0' (48), count=2} + {NOT, count=8} + {'S' (83), count=4} + {NOT, count=16} + {'I' (73), count=4} + {NOT, count=8} + {''' (39), count=4} + {NOT, count=256} + {'y' (121), count=59} + {NOT, count=118} + {'p' (112), count=59} + {NOT, count=479} + {'"' (34), count=8} + {NOT, count=15} + {'-' (45), count=7} + {NOT, count=30} + {'T' (84), count=15} + {NOT, count=58} + {'b' (98), count=28} + {NOT, count=115} + {'m' (109), count=57} + {NOT, count=223} + {'g' (103), count=55} + {NOT, count=108} + {'f' (102), count=53} + {NOT, count=1829} + {'t' (116), count=220} + {NOT, count=433} + {'o' (111), count=213} + {NOT, count=848} + {'i' (105), count=210} + {NOT, count=415} + {'n' (110), count=205} +{NOT, count=3213} + {'l' (108), count=102} + {NOT, count=191} + {'h' (104), count=89} + {NOT, count=379} + {'a' (97), count=188} + {NOT, count=748} + {'r' (114), count=187} + {NOT, count=369} + {'s' (115), count=182} + {NOT, count=1384} + {'c' (99), count=89} + {NOT, count=177} + {'.' (46), count=27} + {NOT, count=50} + {'W' (87), count=3} + {NOT, count=6} + {'R' (82), count=3} + {NOT, count=12} + {'P' (80), count=3} + {NOT, count=6} + {'D' (68), count=3} + {NOT, count=23} + {'C' (67), count=3} + {NOT, count=6} + {'A' (65), count=3} + {NOT, count=11} + {'(' (40), count=3} + {NOT, count=5} + {EOF (256), count=1} + {NOT, count=2} + {'x' (120), count=1} + {NOT, count=88} + {'O' (79), count=5} + {NOT, count=10} + {')' (41), count=5} + {NOT, count=20} + {'k' (107), count=10} + {NOT, count=38} + {'\r' (13), count=9} + {NOT, count=18} + {'\n' (10), count=9} + {NOT, count=336} + {'d' (100), count=82} + {NOT, count=159} + {'u' (117), count=77} + {NOT, count=636} + {'e' (101), count=300} + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 3 +Building encoding map ... + 10: '\n' => 00110000 + 13: '\r' => 00110001 + 32: ' ' => 111 + 34: '"' => 110011111 + 39: ''' => 1101100000 + 40: '(' => 0011010001 + 41: ')' => 001100110 + 44: ',' => 1101110 + 45: '-' => 110011110 + 46: '.' => 0011011 + 48: '0' => 11011000110 + 50: '2' => 110110011010 + 52: '4' => 110110011011 + 58: ':' => 11011000111 + 65: 'A' => 0011010010 + 66: 'B' => 11011001000 + 67: 'C' => 0011010011 + 68: 'D' => 0011010100 + 70: 'F' => 11011001001 + 71: 'G' => 11011001010 + 72: 'H' => 110110011100 + 73: 'I' => 1101100001 + 75: 'K' => 110110011101 + 77: 'M' => 110110011110 + 79: 'O' => 001100111 + 80: 'P' => 0011010101 + 82: 'R' => 0011010110 + 83: 'S' => 1101100010 + 84: 'T' => 11001110 + 87: 'W' => 0011010111 + 97: 'a' => 0110 + 98: 'b' => 1100110 + 99: 'c' => 00111 + 100: 'd' => 00101 + 101: 'e' => 000 + 102: 'f' => 110000 + 103: 'g' => 110001 + 104: 'h' => 01110 + 105: 'i' => 1001 + 106: 'j' => 110110011111 + 107: 'k' => 00110010 + 108: 'l' => 01111 + 109: 'm' => 110010 + 110: 'n' => 1000 + 111: 'o' => 1010 + 112: 'p' => 110100 + 113: 'q' => 11011001011 + 114: 'r' => 0101 + 115: 's' => 0100 + 116: 't' => 1011 + 117: 'u' => 00100 + 118: 'v' => 1101111 + 119: 'w' => 1101101 + 120: 'x' => 00110100000 + 121: 'y' => 110101 + 122: 'z' => 11011001100 + 256: EOF => 00110100001 +57 character encodings found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 4 +Reuse your previous string/file data for encoding? y +Encoding data ... +Here is the binary encoded data (1775 bytes): +11001110 10100101 11011000 11111100 11001111 00010011 01010001 11001101 +01101010 00100101 11001100 01100011 11110110 01110010 01101101 00111101 +10111000 01111101 10010001 00111000 11111100 11101001 11001000 00011000 +10011000 00011000 10011000 01100111 00111000 01111001 00101000 01101111 +01011000 01111010 10001001 10101000 11101011 01000100 10111001 10001100 +01111100 10100111 10001010 10111111 00000011 01101001 10111111 10110000 +11000111 10110111 00001111 10100011 00100101 11101110 11101110 10101101 +10100011 01111000 01011101 11011101 10101110 11000110 01011010 01011010 +01110110 10111110 01010001 10111100 00111110 10110100 10011000 11000111 +11010100 01001101 01000111 01011010 00100101 11001100 01100011 11100000 +01011110 11011010 01010011 00100100 11101110 01101101 11100011 11100100 +00101111 11101101 10011011 01110111 01111000 01000100 11110110 11100110 +10001110 10000100 00111001 11000010 00100001 10111110 01101010 10000101 +11000010 10010111 00100110 10000011 10001101 11011101 00000001 11001000 +10110011 01111010 11101110 11101000 01110110 01111011 01100110 10010111 +11001101 11101011 10111011 10110100 00010111 11001100 00011100 01000101 +11001110 11110001 11011100 11011011 11000110 11101110 01000100 00100011 +00111101 11111010 11111001 10001111 01101101 00000101 00011001 01101110 +11111001 10010110 10001001 10001011 10101111 11101000 10100011 01111100 +11010001 00010011 10110101 11011000 11001011 01001011 01001110 01011010 +11011011 00000110 11111110 01110101 00101110 11101111 00110001 01101011 +01000101 00100001 11000001 01111100 11000111 01101110 10000001 11111000 +01100111 10101110 01101101 11100000 10111111 01000110 11010000 00101111 +11001101 10101111 00110101 10101011 00010000 10111100 11010100 10011000 +11000101 11100000 10110011 00000011 10001011 11101100 11110011 01111011 +10111111 10010100 11101101 11010010 10110011 11000111 01100111 10111100 +00010111 11100111 11010000 00011110 10100000 10111111 00010001 00000001 +01011010 11100110 10100011 00111111 11101010 00100110 10100011 10101101 +00010010 11100110 00110001 11100101 00001001 00111000 11000111 01101000 +00101111 10011100 10110100 01111000 11001000 01000101 10110101 11001101 +01000001 10111111 10110000 11011111 01000000 00001100 10010011 11011101 +01110100 10100111 11101111 00011111 00100110 10001101 01111101 01100001 +11101101 11000011 11101000 10110101 10011001 11100011 00100100 11110110 +11100110 10111111 10100011 11011011 00010010 00000010 11110000 11001010 +11111001 00001011 11101010 00100110 10100011 10101101 00010010 11000010 +10100110 11101110 11010000 01011110 01011010 00001001 11010000 10000111 +00111000 01000100 11000000 10001111 01111110 10111101 10001010 01010101 +00001000 10011111 00100110 10001101 01111100 11100101 10100101 00101101 +10110100 01011111 00111101 01000001 11000010 11000010 00011011 00110001 +00110000 00110001 00110000 00110011 11000100 11010100 01110101 10100010 +01011100 11000110 00111110 01010011 10110100 01110110 11001100 10010110 +10101100 01111011 11101001 10101010 01011000 11001011 11010110 00011111 +00100000 10001000 11011000 10001110 10110100 01001011 10011000 11000111 +11001100 01111101 10101110 10010011 10111011 10110111 00100010 00000101 +11111010 00000101 11000010 10010111 00100100 11111001 00010001 11110111 +00111010 00111100 01110111 10110110 10100001 01010011 11010110 00011100 +01000001 11010111 01011101 00101110 01101010 00111101 01000111 01101111 +10010000 01000100 01101100 01000111 11010001 01100110 10010111 11011101 +01110100 00010000 01011001 10001100 01111100 11011001 10111110 01101001 +00100111 10110111 00001111 10010000 01000100 01101100 01000111 10110101 +01101101 11100001 11101001 11101101 11001011 01000100 11000101 11011101 +10111001 10010100 01010110 11011000 11101000 00101111 11010110 00011101 +01101000 10010110 00010101 00110111 01110000 11000111 01110111 01011010 +00100101 10000101 11111001 11111101 00000000 01111010 01111010 11000011 +00001100 11111111 01101110 11110110 11010100 00101111 10101100 00111000 +10000011 10101110 10111010 01011100 11010100 01111011 10101111 10110101 +11010010 01110111 01111001 10111110 11001111 10101000 00011110 01010011 +11101000 10110011 10111111 01010011 01111100 11010111 01110000 10001111 +01101110 00011111 00100000 10001000 11011000 10001110 11001010 10110011 +10111100 00100111 01101011 11110011 01101001 11001010 00010010 11100110 +00011010 11100110 10100011 01110111 10110111 00001111 01010000 11111101 +01111010 10001100 10011010 01100010 01100011 00011110 00100000 11101011 +10101110 10010111 00110101 00011110 01010011 10101000 11001010 10110111 +10110110 01100111 10001111 10011011 01011111 01101110 00011100 10001000 +00010111 11010100 01111011 01110000 11110101 01101110 00001011 11000100 +00010111 11010110 00011110 11011100 00111110 10010011 10100000 00110111 +11110011 10101001 01111100 11100101 10100010 11010110 11110000 10011100 +10011010 01010100 01110100 10011100 10110100 01111100 10100101 11001001 +11111101 01000100 11010100 01110101 10100010 01011100 11000110 00111111 +00110110 10111101 10001110 11101001 00011011 11100110 00110001 11111000 +00010001 11101111 11111000 01010010 11101101 01100101 00101111 01000000 +01110101 00000111 11010111 01110111 00100010 01001100 01100011 11011011 +10100101 10110100 00010101 10010100 10110011 10110011 00000001 01111110 +01110001 10100110 01101010 11110110 11010011 01000111 11001001 11011010 +11100110 10100011 11101000 10110101 01110100 01111010 01111111 00110100 +01110110 00100011 00111001 10100111 10110011 10111011 00010001 10011011 +01110111 01111101 01101101 00001011 00110001 10001111 10101101 11100001 +01011100 00011000 10111111 00110110 10111111 00100010 00111110 11100111 +01000111 10000011 01000001 00110001 10001111 11001110 00110100 11001101 +01011110 10010110 10100001 10110010 01001111 01101110 01011010 00100110 +00101110 11101001 00110001 10001011 11000111 00111100 10101001 11001001 +00110110 10011011 10111100 11100101 10100010 11010110 11111001 10001100 +01111001 11101010 00110001 00001001 01110011 01010001 11001111 01010001 +01101011 01001111 11011101 11011010 00001011 11011011 11101101 10010010 +10001110 11001010 10101101 10101111 10101100 00111101 01011011 10000010 +11111011 01110100 11000110 00101000 01101111 10011001 11100010 01101010 +00111010 11010001 00101100 00101010 01111011 01110000 11001001 00000011 +11110111 10000100 11100111 01101000 11111001 10000111 01010010 01000111 +11001101 10101111 11011111 01001111 00100100 01011000 00001010 10011101 +10100000 10111100 11110101 00011000 01001110 00100100 01010000 01011111 +01110101 11101101 11010100 10000011 11101111 10100111 10010010 00101100 +00000101 01001101 10000011 10100110 10000000 11110011 10000100 10011101 +10101110 01101010 00010011 01110111 01100111 10111110 10110110 11001100 +01100011 11101101 11000011 11000000 10111101 10110100 10100110 01011110 +11101011 11100010 10110101 10110111 11001100 00010100 01100001 00110001 +00110110 00011111 10101111 11011011 00110110 11101010 00100101 11110011 +10001000 10110101 01100111 11001110 11001100 00000101 11100011 00001100 +00101001 01101100 11011111 00110100 10010011 11010110 00011111 01100110 +10110110 00110110 11000110 11011001 10111101 11011111 00111010 10010111 +11001010 01110110 10001110 11011011 11011010 01011110 11011001 10011110 +00111110 10001011 01000101 00100001 11101111 01110111 01010010 01000100 +01001100 01100011 11101010 00111110 01001100 01110111 01001100 00000100 +11101100 10110100 01001000 00101111 10110111 00001111 10110110 10010101 +11100101 00110111 11110110 00011011 01001110 01110101 00001101 01110100 +10101001 11011100 11011011 11000111 01000000 00100011 11011011 10000100 +10101111 01100101 11000100 10011001 00001000 10110100 11111011 00111110 +01000100 10111001 11000010 01000001 01111110 01101101 01111110 11011001 +00101000 01001101 00010100 00110001 01111011 00010110 10110100 10111001 +10101000 11110101 10000111 10110111 01010010 00001110 11001011 10001001 +00110010 00010001 01101001 11011010 00001011 11101101 11000011 11101000 +10110100 01010010 00011110 11111101 10111000 01101011 11001110 10100001 +10101100 00010100 11011001 10001001 10000001 10001001 10000110 01110011 +10000111 01100010 01011011 10101001 01010011 01100000 11111010 00110110 +10000001 01110111 01111100 11111110 01110101 00101110 11000111 11111001 +11001110 00011111 01100010 00000111 10101000 00101110 01111011 01100101 +00001000 00001010 11010111 00110101 00011100 11001111 00010011 01010001 +11001101 01101010 00100101 10000101 11011101 10011111 11110010 10011101 +10001111 01100100 01100111 10111111 01011111 10111100 00101110 10111111 +01101000 01111011 11111001 11101010 00010010 11010100 10000111 10110000 +01010011 01111100 11010111 01110100 10111100 01111001 10111111 00101001 +11011001 01110001 00100011 01100110 01111110 10111101 11101100 01110011 +00101001 10001100 01111011 01110111 11010101 11111010 11000011 11001100 +01100001 01001011 10010011 01011100 11010100 01110110 10000010 11110110 +10000110 01111110 10101001 00101001 10111011 11001101 11111001 01001111 +00010101 01111110 11011100 11010000 01100100 10011110 11101011 11001100 +00011110 10110010 11010000 01011000 10000011 10001101 11011111 00110001 +00101111 10101011 01011011 10000010 11111100 11011010 11110010 10000100 +10011100 01100000 11011111 11001110 01110000 11111000 11010011 00111101 +00111010 00001011 11111001 10110101 11110110 11100001 11001110 10100001 +10101110 10010101 00111110 11010000 10100011 11101111 00001011 10101111 +00111011 11000011 00101110 11101110 11010000 01011110 01011001 00101111 +10001010 10111111 00110000 01110111 10010000 10100011 10011100 00101101 +10110100 11000111 10101100 11011011 11100110 10001000 10011011 10111011 +01000001 01111110 11110000 10111010 11110010 10000100 10010101 01101100 +11001111 00011111 00011010 01100111 10100001 10111111 10110011 11010100 +10010111 11101011 00001111 01101110 00011111 00011010 01100111 10100111 +11001010 10101110 01110111 10110101 11001100 01100011 11110110 00100111 +11101011 10110010 01100111 10011010 00110110 10100100 00011101 10100010 +10100011 01011100 10100110 11110101 00110011 01110110 01010001 11110010 +10010100 01001001 10001100 01111110 00001011 01011001 01111100 11101010 +01010011 01111111 01100100 01101011 11101101 11000011 10110001 00101101 +11010100 10101001 10110000 01111010 11011011 00011101 10001011 10010100 +10100010 01001101 01000110 11101111 01101110 00010010 10111101 11110101 +10110111 00111100 11110110 10110001 00000111 11010111 10110100 01010100 +01101011 10010100 11011110 10111110 00000101 11101101 10100101 00110010 +11110010 10011101 00101110 01011110 11111111 10111100 10001111 10000000 +10101101 10011001 11100011 11011101 01111101 00010110 10110000 10010111 +11001100 01100011 11011010 00001011 11000100 00010111 00111101 01110101 +10011110 00010000 01011111 01101010 11011000 01100001 00100111 11100111 +10101000 11000010 01010111 00100110 10111001 10101000 00110111 11110011 +10101011 11011011 10000100 10101111 00111010 10000010 11001101 11110111 +01010110 11010001 10111100 00101110 11101110 01101010 01001100 01100010 +11110000 01011001 10000001 11000101 11110110 01111001 10111110 10011010 +00001000 00101111 01101111 10001101 01010001 01111001 01000011 00111111 +11010110 00011110 11100111 00100001 11001011 00101000 01110010 00100010 +01001100 01100011 11101101 11000001 00000111 10010100 01000010 00000100 +11011101 11011001 00111110 11010000 11110111 11110110 01001111 01101110 +00011110 10110011 01101111 10011010 00100010 01110010 11001010 10000011 +11011100 11010100 00100111 11000010 10010111 11100000 01000101 10110111 +00000101 11101010 00010000 00110010 10011101 11011110 01100011 11011011 +10000111 10000000 11001011 11110000 00100101 10010001 01000001 10110011 +00010011 00000011 00010011 00000011 01010000 00100110 10010011 01100011 +11011011 10000111 01111101 01000110 00111101 11101100 01001000 00101010 +11101011 11011111 00101001 01111110 10110000 11110101 10100000 10001111 +10110010 11001000 00010010 11100110 10100001 00111100 11000001 11011110 +01000010 10000010 11110110 10111111 01101110 00011100 01000001 01111101 +01100001 11101101 11000011 11101000 11011010 00000101 11011101 11100110 +11110110 00000100 11101000 11011000 00001111 01110101 11010001 10110101 +11110110 11100110 10111111 01101110 00011110 11110110 11010111 11001100 +10110100 11000101 11100111 01101011 00011000 11010010 11001000 01001111 +01011000 01110010 01000010 01010011 11110111 10000010 11111101 00010110 +10110011 00111100 01100101 11011001 01000111 01100011 00110111 10011000 +00111010 10000110 01000001 11100110 00111010 00000011 10010001 01100110 +11110101 11101101 00000101 11101101 00010101 00011010 11100101 00110111 +10101110 11101110 11010000 01011111 10011000 11001101 11001010 00001110 +10100001 10010000 01111001 10001110 11110110 10110001 00000111 11010111 +10110100 00010111 11100010 00100000 00101011 00111111 11001100 00011101 +01000011 00100000 11110011 00011111 01000000 10111000 01010010 11100100 +11010000 01110001 11001101 00011001 10000011 10111100 10000101 10011000 +11000111 10100001 11011001 11101101 10011010 01011111 00110111 10101001 +10011000 11011111 11001110 10100101 11011101 11110110 10111010 01011110 +00111110 01100001 00110001 10001111 01101110 10101101 01101110 00001011 +11010000 10000111 00111000 01000100 11000000 10001111 11111001 11110111 +11010110 11011100 11110011 11011010 11000100 00011111 01011100 11111111 +01101000 10101000 11010111 00101010 00100010 01110011 11010110 01011001 +00010010 00100100 11101101 01110011 01010001 11010000 00101110 11111001 +00111000 11011101 11100101 00111110 11001011 00100100 11011000 11101000 +11111010 11011010 01101111 11101100 10011010 01011110 10010101 10010000 +11101101 10100110 10001111 10010011 10110101 11001101 01000010 01111001 +10111111 00101001 11110100 01011010 01110100 11100110 10011011 10011101 +11100001 11111010 11110100 10100011 01111100 11010010 01001111 10100010 +10001101 11110011 01000100 01000111 11101011 11110010 00010001 01110011 +01010000 00001011 10111011 11011011 10000010 10001110 11001010 00111011 +00111101 00101011 10110111 11011011 00100101 00011111 01111011 00101100 +10001011 11010111 11010110 00011100 11001010 00101011 01101100 01110110 +01010000 11001001 11110110 10111000 00101000 11101000 00001110 01000101 +10011011 11010111 11001010 01111101 10100001 10001100 10111101 00101111 +00001100 10010010 11111101 01111100 11100101 10100010 11010110 11110000 +01010011 01111100 11010111 01110011 01011111 11001001 10001100 10000010 +01111011 01110100 10100111 01101111 10100011 00101101 11001001 11001000 +11110110 01010111 11101011 11110110 10001001 11000101 11010111 10101111 +11010001 10100101 01111101 01100001 11010100 00100000 01100101 00111011 +10111011 00101000 01100100 11110010 10011110 11011100 11010111 11101101 +11000011 01011110 11001010 00111100 11000011 10000010 10001000 10110111 +11101011 11100110 00111101 01101001 10100101 00100100 11011100 11010100 +00011011 11111011 00101001 01000011 01011000 01011110 10000000 11100100 +01011001 10111101 01111110 01010100 10010111 11101011 00001011 00010001 +11001111 01011001 00000100 11101101 01111110 11011100 00111001 11101001 +00101111 11010110 00011111 01000000 10111000 01010010 11100100 11010000 +01110001 10111011 10110100 00010111 11101111 10010011 10001111 10111100 +00101010 00110001 10111111 10110000 11011111 10010100 11111000 01010010 +11111011 01110100 10100111 01010000 11001001 01010001 11101101 11001101 +01111110 11011100 00010000 01111011 11011011 01011100 11110101 00000111 +00001011 00001001 11011001 01000111 11010000 00101011 10011011 01000100 +11101001 01011001 00001111 01011000 01111011 01110000 11111001 01010010 +01011111 10011100 10110100 10100101 10110110 10001011 11110110 11100110 +10111110 10100001 00000011 00101001 11011100 00010101 00111100 11000111 +10110111 01001010 01111100 00100100 00111100 10111011 10111011 01000001 +01111100 11000111 10110111 00001111 10011001 01101001 10001010 00010111 +11100001 00100001 11100101 11110101 10000111 00111101 01100101 10100001 +00101100 00101111 01000000 01110010 00101100 11011110 10111011 10111110 +00001100 01110000 01101100 11000100 11000000 11010000 10000000 + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 5 +Read from a s)tring or f)ile? s +Type the string to process: 110011101010010111011000111111001100111100000110100001 +Decoding data ... +Here is the decoded data (7 bytes): +Tor: On + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? q +Exiting. diff --git a/labb6/res/output/expected-output-4.txt b/labb6/res/output/expected-output-4.txt new file mode 100755 index 0000000..5d648a1 --- /dev/null +++ b/labb6/res/output/expected-output-4.txt @@ -0,0 +1,135 @@ +Welcome to TDDD86 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. + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? c +Input file name: short.txt +Output file name (Enter for short.huf): short.huf +Reading 131 uncompressed bytes. +Compressing ... +Wrote 215 compressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? b +File name to display: short.huf +Here is the binary encoded data (215 bytes): +11011110 10001100 00001100 01011100 01001100 00110100 00000100 11001100 +01001100 01011100 01001100 01001100 00110100 00000100 10011100 11101100 +01011100 11101100 00110100 00000100 10011100 10011100 01011100 01101100 +00110100 00000100 10001100 00001100 00001100 01011100 10101100 00110100 +00000100 10001100 00001100 10001100 01011100 10001100 10101100 00110100 +00000100 10001100 00001100 01001100 01011100 11001100 00110100 00000100 +10001100 00001100 00101100 01011100 00101100 00110100 00000100 10001100 +00001100 10101100 01011100 01101100 00110100 00000100 10001100 00001100 +00011100 01011100 01101100 00110100 00000100 10001100 00001100 10011100 +01011100 10001100 00110100 00000100 10001100 10001100 00001100 01011100 +01101100 00110100 00000100 10001100 10001100 10001100 01011100 10001100 +00001100 00110100 00000100 10001100 10001100 01001100 01011100 00101100 +00110100 00000100 10001100 10001100 00101100 01011100 11101100 00110100 +00000100 10001100 10001100 10101100 01011100 10001100 00001100 00110100 +00000100 10001100 10001100 01101100 01011100 10001100 00001100 00110100 +00000100 10001100 10001100 11101100 01011100 11001100 00110100 00000100 +10001100 10001100 10011100 01011100 10001100 00110100 00000100 10001100 +01001100 10001100 01011100 11001100 00110100 00000100 01001100 10101100 +01101100 01011100 10001100 10111110 11001000 10000101 11110000 10111110 +10011110 11100011 01001011 10011100 00001010 01000110 11001111 10101000 +00001011 11111011 10101101 00010010 10101011 01110011 11101100 10110000 +00010101 10001001 11111101 01101011 11101110 01001001 10110111 01111101 +00001010 01111100 01101011 01001011 01011101 10100101 10111110 00101111 +00110001 10101101 11000010 10000101 00111110 11001010 01111110 10110101 +11100010 00000100 11111110 11100010 10001010 10011011 11000110 10110111 +11110010 10111100 01011000 11001011 10011110 10001101 11110001 11011110 +01110011 11010001 10010111 11101110 10100110 11100001 10000000 + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? d +Input file name: short.huf +Output file name (Enter for short-out.txt): short-out.txt +Reading 215 compressed bytes. +Decompressing ... +Wrote 131 decompressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? t +File name to display: short-out.txt +Here is the text data (131 bytes): +this is a short input file composed entirely of spaces and lowercase letters +and end of line characters to help you test your code + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? q +Exiting. diff --git a/labb6/res/output/expected-output-5.txt b/labb6/res/output/expected-output-5.txt new file mode 100755 index 0000000..53fd266 --- /dev/null +++ b/labb6/res/output/expected-output-5.txt @@ -0,0 +1,428 @@ +Welcome to TDDD86 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. + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? c +Input file name: hamlet.txt +Output file name (Enter for hamlet.huf): +Reading 191734 uncompressed bytes. +Compressing ... +Wrote 106020 compressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? d +Input file name: hamlet.huf +Output file name (Enter for hamlet-out.txt): hamlet-out.txt +Reading 106020 compressed bytes. +Decompressing ... +Wrote 191734 decompressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? s +First file name: hamlet.txt +Second file name: hamlet-out.txt +Files match! + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 1 +Read from a s)tring or f)ile? f +File name to process: hamlet.txt +Building frequency table ... + 10: '\n' => 4463 + 32: ' ' => 47876 + 33: '!' => 373 + 34: '"' => 1 + 38: '&' => 1 + 39: ''' => 1202 + 40: '(' => 44 + 41: ')' => 43 + 44: ',' => 3001 + 45: '-' => 298 + 46: '.' => 3133 + 48: '0' => 1 + 49: '1' => 7 + 52: '4' => 1 + 54: '6' => 1 + 58: ':' => 32 + 59: ';' => 442 + 63: '?' => 452 + 65: 'A' => 633 + 66: 'B' => 262 + 67: 'C' => 176 + 68: 'D' => 132 + 69: 'E' => 238 + 70: 'F' => 201 + 71: 'G' => 250 + 72: 'H' => 892 + 73: 'I' => 854 + 74: 'J' => 9 + 75: 'K' => 180 + 76: 'L' => 249 + 77: 'M' => 252 + 78: 'N' => 180 + 79: 'O' => 376 + 80: 'P' => 236 + 81: 'Q' => 112 + 82: 'R' => 139 + 83: 'S' => 253 + 84: 'T' => 790 + 85: 'U' => 36 + 86: 'V' => 33 + 87: 'W' => 485 + 89: 'Y' => 130 + 91: '[' => 116 + 93: ']' => 112 + 97: 'a' => 9317 + 98: 'b' => 1568 + 99: 'c' => 2430 + 100: 'd' => 4893 + 101: 'e' => 14722 + 102: 'f' => 2497 + 103: 'g' => 2170 + 104: 'h' => 7839 + 105: 'i' => 7657 + 106: 'j' => 101 + 107: 'k' => 1092 + 108: 'l' => 5598 + 109: 'm' => 4001 + 110: 'n' => 8117 + 111: 'o' => 10842 + 112: 'p' => 1780 + 113: 'q' => 108 + 114: 'r' => 7638 + 115: 's' => 8126 + 116: 't' => 11073 + 117: 'u' => 4307 + 118: 'v' => 1189 + 119: 'w' => 2647 + 120: 'x' => 179 + 121: 'y' => 3074 + 122: 'z' => 72 + 256: EOF => 1 +71 character frequencies found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 2 +Building encoding tree ... + {'s' (115), count=8126} + {NOT, count=16243} + {'n' (110), count=8117} + {NOT, count=31739} + {'h' (104), count=7839} + {NOT, count=15496} + {'i' (105), count=7657} + {NOT, count=61684} + {'r' (114), count=7638} + {NOT, count=15223} + {'m' (109), count=4001} + {NOT, count=7585} + {'P' (80), count=236} + {NOT, count=460} + {']' (93), count=112} + {NOT, count=224} + {'Q' (81), count=112} + {NOT, count=912} + {'?' (63), count=452} + {NOT, count=1804} + {'H' (72), count=892} + {NOT, count=3584} + {'p' (112), count=1780} + {NOT, count=29945} + {'e' (101), count=14722} + {NOT, count=109560} + {' ' (32), count=47876} +{NOT, count=191735} + {'I' (73), count=854} + {NOT, count=1706} + {';' (59), count=442} + {NOT, count=852} + {'q' (113), count=108} + {NOT, count=209} + {'j' (106), count=101} + {NOT, count=410} + {'F' (70), count=201} + {NOT, count=3274} + {'b' (98), count=1568} + {NOT, count=6407} + {'.' (46), count=3133} + {NOT, count=12482} + {'y' (121), count=3074} + {NOT, count=6075} + {',' (44), count=3001} + {NOT, count=23614} + {'l' (108), count=5598} + {NOT, count=11132} + {'T' (84), count=790} + {NOT, count=1539} + {'O' (79), count=376} + {NOT, count=749} + {'!' (33), count=373} + {NOT, count=2887} + {'N' (78), count=180} + {NOT, count=360} + {'K' (75), count=180} + {NOT, count=715} + {'x' (120), count=179} + {NOT, count=355} + {'C' (67), count=176} + {NOT, count=1348} + {'A' (65), count=633} + {NOT, count=5534} + {'w' (119), count=2647} + {NOT, count=45529} + {'t' (116), count=11073} + {NOT, count=21915} + {'o' (111), count=10842} + {NOT, count=82175} + {'f' (102), count=2497} + {NOT, count=4927} + {'c' (99), count=2430} + {NOT, count=9820} + {'d' (100), count=4893} + {NOT, count=19137} + {'a' (97), count=9317} + {NOT, count=36646} + {''' (39), count=1202} + {NOT, count=2391} + {'v' (118), count=1189} + {NOT, count=4603} + {'(' (40), count=44} + {NOT, count=87} + {')' (41), count=43} + {NOT, count=159} + {'z' (122), count=72} + {NOT, count=298} + {'R' (82), count=139} + {NOT, count=596} + {'-' (45), count=298} + {NOT, count=1120} + {'D' (68), count=132} + {NOT, count=262} + {'Y' (89), count=130} + {NOT, count=524} + {'B' (66), count=262} + {NOT, count=2212} + {'k' (107), count=1092} + {NOT, count=9066} + {'\n' (10), count=4463} + {NOT, count=17509} + {'u' (117), count=4307} + {NOT, count=8443} + {'g' (103), count=2170} + {NOT, count=4136} + {'S' (83), count=253} + {NOT, count=505} + {'M' (77), count=252} + {NOT, count=1004} + {'G' (71), count=250} + {NOT, count=499} + {'L' (76), count=249} + {NOT, count=1966} + {'W' (87), count=485} + {NOT, count=962} + {'U' (85), count=36} + {NOT, count=69} + {'V' (86), count=33} + {NOT, count=123} + {':' (58), count=32} + {NOT, count=54} + {'1' (49), count=7} + {NOT, count=13} + {'4' (52), count=1} + {NOT, count=2} + {'0' (48), count=1} + {NOT, count=4} + {'&' (38), count=1} + {NOT, count=2} + {'"' (34), count=1} + {NOT, count=6} + {EOF (256), count=1} + {NOT, count=2} + {'6' (54), count=1} + {NOT, count=22} + {'J' (74), count=9} + {NOT, count=239} + {'[' (91), count=116} + {NOT, count=477} + {'E' (69), count=238} + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 3 +Building encoding map ... + 10: '\n' => 00010 + 32: ' ' => 10 + 33: '!' => 011001100 + 34: '"' => 00000000110010100 + 38: '&' => 00000000110010101 + 39: ''' => 0001111 + 40: '(' => 000110111111 + 41: ')' => 000110111110 + 44: ',' => 011100 + 45: '-' => 000110110 + 46: '.' => 011110 + 48: '0' => 00000000110010110 + 49: '1' => 00000000110011 + 52: '4' => 00000000110010111 + 54: '6' => 0000000011001000 + 58: ':' => 000000001101 + 59: ';' => 011111101 + 63: '?' => 110100110 + 65: 'A' => 01100100 + 66: 'B' => 000110100 + 67: 'C' => 0110010100 + 68: 'D' => 0001101011 + 69: 'E' => 000000000 + 70: 'F' => 0111111000 + 71: 'G' => 000000101 + 72: 'H' => 11010010 + 73: 'I' => 01111111 + 74: 'J' => 0000000011000 + 75: 'K' => 0110010110 + 76: 'L' => 000000100 + 77: 'M' => 000000110 + 78: 'N' => 0110010111 + 79: 'O' => 011001101 + 80: 'P' => 1101001111 + 81: 'Q' => 11010011100 + 82: 'R' => 0001101110 + 83: 'S' => 000000111 + 84: 'T' => 01100111 + 85: 'U' => 000000001111 + 86: 'V' => 000000001110 + 87: 'W' => 00000001 + 89: 'Y' => 0001101010 + 91: '[' => 0000000010 + 93: ']' => 11010011101 + 97: 'a' => 0010 + 98: 'b' => 0111110 + 99: 'c' => 001110 + 100: 'd' => 00110 + 101: 'e' => 1100 + 102: 'f' => 001111 + 103: 'g' => 000001 + 104: 'h' => 11101 + 105: 'i' => 11100 + 106: 'j' => 01111110010 + 107: 'k' => 0001100 + 108: 'l' => 01101 + 109: 'm' => 110101 + 110: 'n' => 11110 + 111: 'o' => 0100 + 112: 'p' => 1101000 + 113: 'q' => 01111110011 + 114: 'r' => 11011 + 115: 's' => 11111 + 116: 't' => 0101 + 117: 'u' => 00001 + 118: 'v' => 0001110 + 119: 'w' => 011000 + 120: 'x' => 0110010101 + 121: 'y' => 011101 + 122: 'z' => 00011011110 + 256: EOF => 0000000011001001 +71 character encodings found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? q +Exiting. diff --git a/labb6/res/output/expected-output-6.txt b/labb6/res/output/expected-output-6.txt new file mode 100755 index 0000000..21cf312 --- /dev/null +++ b/labb6/res/output/expected-output-6.txt @@ -0,0 +1,424 @@ +Welcome to TDDD86 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. + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? c +Input file name: tomsawyer.txt +Output file name (Enter for tomsawyer.huf): +Reading 386501 uncompressed bytes. +Compressing ... +Wrote 221396 compressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? d +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. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? s +First file name: tomsawyer.txt +Second file name: tomsawyer-out.txt +Files match! + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 1 +Read from a s)tring or f)ile? f +File name to process: tomsawyer.txt +Building frequency table ... + 10: '\n' => 8356 + 32: ' ' => 63687 + 33: '!' => 644 + 34: '"' => 3045 + 38: '&' => 1 + 39: ''' => 2424 + 40: '(' => 16 + 41: ')' => 16 + 42: '*' => 4 + 44: ',' => 4927 + 45: '-' => 2269 + 46: '.' => 3878 + 50: '2' => 9 + 58: ':' => 244 + 59: ';' => 639 + 63: '?' => 457 + 65: 'A' => 591 + 66: 'B' => 445 + 67: 'C' => 134 + 68: 'D' => 208 + 69: 'E' => 193 + 70: 'F' => 79 + 71: 'G' => 93 + 72: 'H' => 969 + 73: 'I' => 1492 + 74: 'J' => 258 + 75: 'K' => 24 + 76: 'L' => 169 + 77: 'M' => 251 + 78: 'N' => 324 + 79: 'O' => 294 + 80: 'P' => 269 + 81: 'Q' => 6 + 82: 'R' => 126 + 83: 'S' => 603 + 84: 'T' => 1927 + 85: 'U' => 57 + 86: 'V' => 32 + 87: 'W' => 584 + 88: 'X' => 51 + 89: 'Y' => 216 + 91: '[' => 16 + 93: ']' => 16 + 97: 'a' => 22886 + 98: 'b' => 4513 + 99: 'c' => 6363 + 100: 'd' => 14641 + 101: 'e' => 35407 + 102: 'f' => 5924 + 103: 'g' => 6513 + 104: 'h' => 18595 + 105: 'i' => 17319 + 106: 'j' => 381 + 107: 'k' => 3001 + 108: 'l' => 11967 + 109: 'm' => 6884 + 110: 'n' => 19821 + 111: 'o' => 22897 + 112: 'p' => 4411 + 113: 'q' => 171 + 114: 'r' => 15120 + 115: 's' => 17112 + 116: 't' => 26896 + 117: 'u' => 8884 + 118: 'v' => 2335 + 119: 'w' => 7458 + 120: 'x' => 299 + 121: 'y' => 6509 + 122: 'z' => 151 + 256: EOF => 1 +70 character frequencies found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 2 +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} + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 3 +Building encoding map ... + 10: '\n' => 111110 + 32: ' ' => 110 + 33: '!' => 011001001 + 34: '"' => 1001100 + 38: '&' => 1110111111011101100 + 39: ''' => 0011111 + 40: '(' => 111011111101010 + 41: ')' => 111011111101011 + 42: '*' => 111011111101110111 + 44: ',' => 011000 + 45: '-' => 0011100 + 46: '.' => 1110110 + 50: '2' => 1110111111011100 + 58: ':' => 10011011110 + 59: ';' => 011001000 + 63: '?' => 1001101110 + 65: 'A' => 001111001 + 66: 'B' => 1001101100 + 67: 'C' => 111011111100 + 68: 'D' => 01100101111 + 69: 'E' => 01100101110 + 70: 'F' => 011001010110 + 71: 'G' => 011001010111 + 72: 'H' => 111011110 + 73: 'I' => 10011010 + 74: 'J' => 11101111100 + 75: 'K' => 111011111101111 + 76: 'L' => 00111101111 + 77: 'M' => 10011011111 + 78: 'N' => 0110010100 + 79: 'O' => 11101111111 + 80: 'P' => 11101111101 + 81: 'Q' => 11101111110111010 + 82: 'R' => 100110110111 + 83: 'S' => 001111010 + 84: 'T' => 11101110 + 85: 'U' => 1001101101101 + 86: 'V' => 11101111110100 + 87: 'W' => 001111000 + 88: 'X' => 1001101101100 + 89: 'Y' => 10011011010 + 91: '[' => 111011111101100 + 93: ']' => 111011111101101 + 97: 'a' => 0111 + 98: 'b' => 001101 + 99: 'c' => 100101 + 100: 'd' => 10111 + 101: 'e' => 000 + 102: 'f' => 100100 + 103: 'g' => 101100 + 104: 'h' => 0100 + 105: 'i' => 0010 + 106: 'j' => 0110010110 + 107: 'k' => 0110011 + 108: 'l' => 01101 + 109: 'm' => 101101 + 110: 'n' => 0101 + 111: 'o' => 1000 + 112: 'p' => 001100 + 113: 'q' => 01100101010 + 114: 'r' => 11100 + 115: 's' => 11110 + 116: 't' => 1010 + 117: 'u' => 111111 + 118: 'v' => 0011101 + 119: 'w' => 111010 + 120: 'x' => 0011110110 + 121: 'y' => 100111 + 122: 'z' => 00111101110 + 256: EOF => 1110111111011101101 +70 character encodings found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? q +Exiting. diff --git a/labb6/res/output/expected-output-7.txt b/labb6/res/output/expected-output-7.txt new file mode 100755 index 0000000..b6369ef --- /dev/null +++ b/labb6/res/output/expected-output-7.txt @@ -0,0 +1,1300 @@ +Welcome to TDDD86 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. + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? c +Input file name: hellokitty.bmp +Output file name (Enter for hellokitty.huf): +Reading 1470054 uncompressed bytes. +Compressing ... +Wrote 415668 compressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? d +Input file name: hellokitty.huf +Output file name (Enter for hellokitty-out.txt): hellokitty-out.bmp +Reading 415668 compressed bytes. +Decompressing ... +Wrote 1470054 decompressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? s +First file name: hellokitty.bmp +Second file name: hellokitty-out.bmp +Files match! + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? c +Input file name: moo.wav +Output file name (Enter for moo.huf): +Reading 65580 uncompressed bytes. +Compressing ... +Wrote 21720 compressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? d +Input file name: moo.huf +Output file name (Enter for moo-out.txt): moo-out.wav +Reading 21720 compressed bytes. +Decompressing ... +Wrote 65580 decompressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? s +First file name: moo.wav +Second file name: moo-out.wav +Files match! + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? c +Input file name: bender.jpg +Output file name (Enter for bender.huf): +Reading 52404 uncompressed bytes. +Compressing ... +Wrote 52434 compressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? d +Input file name: bender.huf +Output file name (Enter for bender-out.txt): bender-out.jpg +Reading 52434 compressed bytes. +Decompressing ... +Wrote 52404 decompressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? s +First file name: bender.jpg +Second file name: bender-out.jpg +Files match! + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 1 +Read from a s)tring or f)ile? f +File name to process: bender.jpg +Building frequency table ... + 0: '\0' => 1922 + 1: ??? => 462 + 2: ??? => 463 + 3: ??? => 177 + 4: ??? => 123 + 5: ??? => 350 + 6: ??? => 117 + 7: ??? => 191 + 8: '\b' => 120 + 9: '\t' => 116 + 10: '\n' => 357 + 11: ??? => 134 + 12: '\f' => 120 + 13: '\r' => 150 + 14: ??? => 133 + 15: ??? => 208 + 16: ??? => 101 + 17: ??? => 155 + 18: ??? => 142 + 19: ??? => 147 + 20: ??? => 1441 + 21: ??? => 189 + 22: ??? => 133 + 23: ??? => 155 + 24: ??? => 134 + 25: ??? => 134 + 26: ??? => 161 + 27: ??? => 162 + 28: ??? => 128 + 29: ??? => 169 + 30: ??? => 252 + 31: ??? => 267 + 32: ' ' => 127 + 33: '!' => 109 + 34: '"' => 102 + 35: '#' => 170 + 36: '$' => 151 + 37: '%' => 110 + 38: '&' => 118 + 39: ''' => 180 + 40: '(' => 1403 + 41: ')' => 108 + 42: '*' => 135 + 43: '+' => 226 + 44: ',' => 115 + 45: '-' => 165 + 46: '.' => 142 + 47: '/' => 168 + 48: '0' => 110 + 49: '1' => 134 + 50: '2' => 130 + 51: '3' => 130 + 52: '4' => 163 + 53: '5' => 191 + 54: '6' => 136 + 55: '7' => 156 + 56: '8' => 109 + 57: '9' => 123 + 58: ':' => 168 + 59: ';' => 150 + 60: '<' => 198 + 61: '=' => 172 + 62: '>' => 191 + 63: '?' => 297 + 64: '@' => 318 + 65: 'A' => 131 + 66: 'B' => 96 + 67: 'C' => 133 + 68: 'D' => 109 + 69: 'E' => 1250 + 70: 'F' => 129 + 71: 'G' => 218 + 72: 'H' => 143 + 73: 'I' => 162 + 74: 'J' => 105 + 75: 'K' => 160 + 76: 'L' => 95 + 77: 'M' => 144 + 78: 'N' => 126 + 79: 'O' => 233 + 80: 'P' => 438 + 81: 'Q' => 1138 + 82: 'R' => 123 + 83: 'S' => 138 + 84: 'T' => 108 + 85: 'U' => 137 + 86: 'V' => 162 + 87: 'W' => 228 + 88: 'X' => 132 + 89: 'Y' => 146 + 90: 'Z' => 178 + 91: '[' => 199 + 92: '\' => 136 + 93: ']' => 170 + 94: '^' => 190 + 95: '_' => 205 + 96: '`' => 92 + 97: 'a' => 124 + 98: 'b' => 102 + 99: 'c' => 165 + 100: 'd' => 121 + 101: 'e' => 133 + 102: 'f' => 108 + 103: 'g' => 178 + 104: 'h' => 139 + 105: 'i' => 178 + 106: 'j' => 171 + 107: 'k' => 221 + 108: 'l' => 118 + 109: 'm' => 186 + 110: 'n' => 142 + 111: 'o' => 216 + 112: 'p' => 100 + 113: 'q' => 136 + 114: 'r' => 137 + 115: 's' => 152 + 116: 't' => 148 + 117: 'u' => 186 + 118: 'v' => 153 + 119: 'w' => 179 + 120: 'x' => 236 + 121: 'y' => 174 + 122: 'z' => 161 + 123: '{' => 188 + 124: '|' => 236 + 125: '}' => 198 + 126: '~' => 187 + 127: ??? => 296 + 128: ??? => 337 + 129: ??? => 115 + 130: ??? => 129 + 131: ??? => 164 + 132: ??? => 113 + 133: ??? => 165 + 134: ??? => 146 + 135: ??? => 189 + 136: ??? => 131 + 137: ??? => 145 + 138: ??? => 1248 + 139: ??? => 151 + 140: ??? => 159 + 141: ??? => 188 + 142: ??? => 169 + 143: ??? => 259 + 144: ??? => 103 + 145: ??? => 158 + 146: ??? => 146 + 147: ??? => 143 + 148: ??? => 111 + 149: ??? => 151 + 150: ??? => 141 + 151: ??? => 168 + 152: ??? => 83 + 153: ??? => 116 + 154: ??? => 167 + 155: ??? => 147 + 156: ??? => 102 + 157: ??? => 173 + 158: ??? => 165 + 159: ??? => 254 + 160: ??? => 498 + 161: ??? => 131 + 162: ??? => 1074 + 163: ??? => 158 + 164: ??? => 150 + 165: ??? => 148 + 166: ??? => 137 + 167: ??? => 189 + 168: ??? => 132 + 169: ??? => 144 + 170: ??? => 127 + 171: ??? => 172 + 172: ??? => 150 + 173: ??? => 182 + 174: ??? => 221 + 175: ??? => 247 + 176: ??? => 96 + 177: ??? => 150 + 178: ??? => 137 + 179: ??? => 162 + 180: ??? => 201 + 181: ??? => 201 + 182: ??? => 150 + 183: ??? => 199 + 184: ??? => 150 + 185: ??? => 171 + 186: ??? => 176 + 187: ??? => 148 + 188: ??? => 180 + 189: ??? => 166 + 190: ??? => 207 + 191: ??? => 200 + 192: ??? => 139 + 193: ??? => 131 + 194: ??? => 160 + 195: ??? => 207 + 196: ??? => 203 + 197: ??? => 199 + 198: ??? => 188 + 199: ??? => 212 + 200: ??? => 124 + 201: ??? => 128 + 202: ??? => 126 + 203: ??? => 144 + 204: ??? => 116 + 205: ??? => 147 + 206: ??? => 136 + 207: ??? => 199 + 208: ??? => 145 + 209: ??? => 157 + 210: ??? => 190 + 211: ??? => 196 + 212: ??? => 186 + 213: ??? => 158 + 214: ??? => 170 + 215: ??? => 182 + 216: ??? => 119 + 217: ??? => 132 + 218: ??? => 211 + 219: ??? => 144 + 220: ??? => 145 + 221: ??? => 170 + 222: ??? => 175 + 223: ??? => 205 + 224: ??? => 190 + 225: ??? => 251 + 226: ??? => 283 + 227: ??? => 199 + 228: ??? => 128 + 229: ??? => 116 + 230: ??? => 135 + 231: ??? => 169 + 232: ??? => 163 + 233: ??? => 198 + 234: ??? => 195 + 235: ??? => 153 + 236: ??? => 138 + 237: ??? => 206 + 238: ??? => 157 + 239: ??? => 152 + 240: ??? => 317 + 241: ??? => 351 + 242: ??? => 142 + 243: ??? => 157 + 244: ??? => 195 + 245: ??? => 196 + 246: ??? => 204 + 247: ??? => 182 + 248: ??? => 413 + 249: ??? => 123 + 250: ??? => 165 + 251: ??? => 189 + 252: ??? => 307 + 253: ??? => 219 + 254: ??? => 312 + 255: ??? => 424 + 256: EOF => 1 +257 character frequencies found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 2 +Building encoding tree ... + {??? (182), count=150} + {NOT, count=300} + {??? (177), count=150} + {NOT, count=600} + {??? (172), count=150} + {NOT, count=300} + {??? (164), count=150} + {NOT, count=1197} + {';' (59), count=150} + {NOT, count=300} + {'\r' (13), count=150} + {NOT, count=597} + {'?' (63), count=297} + {NOT, count=2378} + {??? (187), count=148} + {NOT, count=296} + {??? (165), count=148} + {NOT, count=592} + {??? (127), count=296} + {NOT, count=1181} + {'t' (116), count=148} + {NOT, count=295} + {??? (205), count=147} + {NOT, count=589} + {??? (155), count=147} + {NOT, count=294} + {??? (19), count=147} + {NOT, count=4681} + {??? (146), count=146} + {NOT, count=292} + {??? (134), count=146} + {NOT, count=583} + {'Y' (89), count=146} + {NOT, count=291} + {??? (220), count=145} + {NOT, count=1161} + {??? (208), count=145} + {NOT, count=290} + {??? (137), count=145} + {NOT, count=578} + {??? (219), count=144} + {NOT, count=288} + {??? (203), count=144} + {NOT, count=2303} + {??? (169), count=144} + {NOT, count=288} + {'M' (77), count=144} + {NOT, count=574} + {??? (147), count=143} + {NOT, count=286} + {'H' (72), count=143} + {NOT, count=1142} + {??? (242), count=142} + {NOT, count=284} + {'n' (110), count=142} + {NOT, count=568} + {'.' (46), count=142} + {NOT, count=284} + {??? (18), count=142} + {NOT, count=9098} + {'Q' (81), count=1138} + {NOT, count=2253} + {??? (226), count=283} + {NOT, count=563} + {??? (150), count=141} + {NOT, count=280} + {??? (192), count=139} + {NOT, count=1115} + {'h' (104), count=139} + {NOT, count=277} + {??? (236), count=138} + {NOT, count=552} + {'S' (83), count=138} + {NOT, count=275} + {??? (178), count=137} + {NOT, count=4417} + {??? (166), count=137} + {NOT, count=274} + {'r' (114), count=137} + {NOT, count=547} + {'U' (85), count=137} + {NOT, count=273} + {??? (206), count=136} + {NOT, count=1090} + {'q' (113), count=136} + {NOT, count=272} + {'\' (92), count=136} + {NOT, count=543} + {'6' (54), count=136} + {NOT, count=271} + {??? (230), count=135} + {NOT, count=2164} + {??? (162), count=1074} + {NOT, count=17196} + {'*' (42), count=135} + {NOT, count=269} + {'1' (49), count=134} + {NOT, count=537} + {??? (25), count=134} + {NOT, count=268} + {??? (24), count=134} + {NOT, count=1071} + {??? (11), count=134} + {NOT, count=267} + {'e' (101), count=133} + {NOT, count=534} + {??? (31), count=267} + {NOT, count=2128} + {'C' (67), count=133} + {NOT, count=266} + {??? (22), count=133} + {NOT, count=531} + {??? (14), count=133} + {NOT, count=265} + {??? (217), count=132} + {NOT, count=1057} + {??? (168), count=132} + {NOT, count=264} + {'X' (88), count=132} + {NOT, count=526} + {??? (193), count=131} + {NOT, count=262} + {??? (161), count=131} + {NOT, count=4185} + {??? (136), count=131} + {NOT, count=262} + {'A' (65), count=131} + {NOT, count=522} + {'3' (51), count=130} + {NOT, count=260} + {'2' (50), count=130} + {NOT, count=1039} + {??? (143), count=259} + {NOT, count=517} + {??? (130), count=129} + {NOT, count=258} + {'F' (70), count=129} + {NOT, count=2057} + {??? (228), count=128} + {NOT, count=256} + {??? (201), count=128} + {NOT, count=511} + {??? (28), count=128} + {NOT, count=255} + {??? (170), count=127} + {NOT, count=1018} + {??? (159), count=254} + {NOT, count=507} + {' ' (32), count=127} + {NOT, count=253} + {??? (202), count=126} + {NOT, count=8098} + {??? (30), count=252} + {NOT, count=503} + {??? (225), count=251} + {NOT, count=1001} + {??? (160), count=498} + {NOT, count=1991} + {'N' (78), count=126} + {NOT, count=250} + {??? (200), count=124} + {NOT, count=497} + {'a' (97), count=124} + {NOT, count=247} + {??? (249), count=123} + {NOT, count=990} + {??? (175), count=247} + {NOT, count=493} + {'R' (82), count=123} + {NOT, count=246} + {'9' (57), count=123} + {NOT, count=3913} + {'\0' (0), count=1922} + {NOT, count=30820} + {??? (4), count=123} + {NOT, count=244} + {'d' (100), count=121} + {NOT, count=484} + {'\f' (12), count=120} + {NOT, count=240} + {'\b' (8), count=120} + {NOT, count=957} + {??? (216), count=119} + {NOT, count=237} + {'l' (108), count=118} + {NOT, count=473} + {'|' (124), count=236} + {NOT, count=1893} + {'x' (120), count=236} + {NOT, count=471} + {'&' (38), count=118} + {NOT, count=235} + {??? (6), count=117} + {NOT, count=936} + {'O' (79), count=233} + {NOT, count=465} + {??? (229), count=116} + {NOT, count=232} + {??? (204), count=116} + {NOT, count=3734} + {??? (2), count=463} + {NOT, count=925} + {??? (153), count=116} + {NOT, count=232} + {'\t' (9), count=116} + {NOT, count=462} + {??? (129), count=115} + {NOT, count=230} + {',' (44), count=115} + {NOT, count=1841} + {??? (1), count=462} + {NOT, count=916} + {'W' (87), count=228} + {NOT, count=454} + {'+' (43), count=226} + {NOT, count=7209} + {??? (132), count=113} + {NOT, count=224} + {??? (148), count=111} + {NOT, count=445} + {??? (174), count=221} + {NOT, count=886} + {'k' (107), count=221} + {NOT, count=441} + {'0' (48), count=110} + {NOT, count=220} + {'%' (37), count=110} + {NOT, count=1761} + {'P' (80), count=438} + {NOT, count=875} + {??? (253), count=219} + {NOT, count=437} + {'D' (68), count=109} + {NOT, count=218} + {'8' (56), count=109} + {NOT, count=3475} + {'G' (71), count=218} + {NOT, count=435} + {'!' (33), count=109} + {NOT, count=217} + {'f' (102), count=108} + {NOT, count=867} + {'T' (84), count=108} + {NOT, count=216} + {')' (41), count=108} + {NOT, count=432} + {'o' (111), count=216} + {NOT, count=1714} + {??? (255), count=424} + {NOT, count=847} + {??? (199), count=212} + {NOT, count=423} + {??? (218), count=211} + {NOT, count=13624} + {'J' (74), count=105} + {NOT, count=208} + {??? (144), count=103} + {NOT, count=416} + {??? (15), count=208} + {NOT, count=830} + {??? (195), count=207} + {NOT, count=414} + {??? (190), count=207} + {NOT, count=1654} + {??? (248), count=413} + {NOT, count=824} + {??? (237), count=206} + {NOT, count=411} + {??? (223), count=205} + {NOT, count=3275} + {'_' (95), count=205} + {NOT, count=409} + {??? (156), count=102} + {NOT, count=204} + {'b' (98), count=102} + {NOT, count=816} + {??? (246), count=204} + {NOT, count=407} + {'"' (34), count=102} + {NOT, count=203} + {??? (16), count=101} + {NOT, count=1621} + {??? (196), count=203} + {NOT, count=404} + {??? (181), count=201} + {NOT, count=805} + {??? (180), count=201} + {NOT, count=401} + {??? (191), count=200} + {NOT, count=6415} + {??? (227), count=199} + {NOT, count=398} + {??? (207), count=199} + {NOT, count=796} + {??? (197), count=199} + {NOT, count=398} + {??? (183), count=199} + {NOT, count=1589} + {'[' (91), count=199} + {NOT, count=397} + {??? (233), count=198} + {NOT, count=793} + {'}' (125), count=198} + {NOT, count=396} + {'<' (60), count=198} + {NOT, count=3140} + {'p' (112), count=100} + {NOT, count=196} + {??? (176), count=96} + {NOT, count=392} + {??? (245), count=196} + {NOT, count=783} + {??? (211), count=196} + {NOT, count=391} + {??? (244), count=195} + {NOT, count=1551} + {??? (234), count=195} + {NOT, count=386} + {'B' (66), count=96} + {NOT, count=191} + {'L' (76), count=95} + {NOT, count=768} + {'>' (62), count=191} + {NOT, count=382} + {'5' (53), count=191} +{NOT, count=52405} + {??? (7), count=191} + {NOT, count=381} + {??? (224), count=190} + {NOT, count=761} + {??? (210), count=190} + {NOT, count=380} + {'^' (94), count=190} + {NOT, count=1517} + {??? (251), count=189} + {NOT, count=378} + {??? (167), count=189} + {NOT, count=756} + {??? (135), count=189} + {NOT, count=378} + {??? (21), count=189} + {NOT, count=3008} + {??? (198), count=188} + {NOT, count=376} + {??? (141), count=188} + {NOT, count=751} + {'{' (123), count=188} + {NOT, count=375} + {'~' (126), count=187} + {NOT, count=1491} + {??? (212), count=186} + {NOT, count=372} + {'u' (117), count=186} + {NOT, count=740} + {'m' (109), count=186} + {NOT, count=368} + {??? (247), count=182} + {NOT, count=5887} + {??? (20), count=1441} + {NOT, count=2879} + {??? (215), count=182} + {NOT, count=364} + {??? (173), count=182} + {NOT, count=724} + {??? (188), count=180} + {NOT, count=360} + {''' (39), count=180} + {NOT, count=1438} + {'w' (119), count=179} + {NOT, count=357} + {'i' (105), count=178} + {NOT, count=714} + {'\n' (10), count=357} + {NOT, count=11439} + {'g' (103), count=178} + {NOT, count=356} + {'Z' (90), count=178} + {NOT, count=709} + {??? (3), count=177} + {NOT, count=353} + {'`' (96), count=92} + {NOT, count=176} + {??? (152), count=83} + {NOT, count=84} + {EOF (256), count=1} + {NOT, count=1411} + {??? (186), count=176} + {NOT, count=351} + {??? (222), count=175} + {NOT, count=702} + {??? (241), count=351} + {NOT, count=2814} + {'(' (40), count=1403} + {NOT, count=5552} + {??? (5), count=350} + {NOT, count=697} + {'y' (121), count=174} + {NOT, count=347} + {??? (157), count=173} + {NOT, count=1383} + {??? (171), count=172} + {NOT, count=344} + {'=' (61), count=172} + {NOT, count=686} + {??? (185), count=171} + {NOT, count=342} + {'j' (106), count=171} + {NOT, count=2738} + {??? (221), count=170} + {NOT, count=340} + {??? (214), count=170} + {NOT, count=680} + {']' (93), count=170} + {NOT, count=340} + {'#' (35), count=170} + {NOT, count=1355} + {??? (231), count=169} + {NOT, count=338} + {??? (142), count=169} + {NOT, count=675} + {??? (29), count=169} + {NOT, count=337} + {??? (151), count=168} + {NOT, count=21585} + {??? (128), count=337} + {NOT, count=673} + {':' (58), count=168} + {NOT, count=336} + {'/' (47), count=168} + {NOT, count=1336} + {??? (154), count=167} + {NOT, count=333} + {??? (189), count=166} + {NOT, count=663} + {??? (250), count=165} + {NOT, count=330} + {??? (158), count=165} + {NOT, count=2645} + {??? (133), count=165} + {NOT, count=330} + {'c' (99), count=165} + {NOT, count=659} + {'-' (45), count=165} + {NOT, count=329} + {??? (131), count=164} + {NOT, count=1309} + {??? (232), count=163} + {NOT, count=326} + {'4' (52), count=163} + {NOT, count=650} + {??? (179), count=162} + {NOT, count=324} + {'V' (86), count=162} + {NOT, count=5193} + {'I' (73), count=162} + {NOT, count=324} + {??? (27), count=162} + {NOT, count=646} + {'z' (122), count=161} + {NOT, count=322} + {??? (26), count=161} + {NOT, count=1284} + {??? (194), count=160} + {NOT, count=320} + {'K' (75), count=160} + {NOT, count=638} + {'@' (64), count=318} + {NOT, count=2548} + {??? (140), count=159} + {NOT, count=317} + {??? (213), count=158} + {NOT, count=634} + {??? (240), count=317} + {NOT, count=1264} + {??? (163), count=158} + {NOT, count=316} + {??? (145), count=158} + {NOT, count=630} + {??? (243), count=157} + {NOT, count=314} + {??? (238), count=157} + {NOT, count=10146} + {'E' (69), count=1250} + {NOT, count=2498} + {??? (138), count=1248} + {NOT, count=4953} + {??? (209), count=157} + {NOT, count=313} + {'7' (55), count=156} + {NOT, count=625} + {??? (254), count=312} + {NOT, count=1242} + {??? (23), count=155} + {NOT, count=310} + {??? (17), count=155} + {NOT, count=617} + {??? (252), count=307} + {NOT, count=2455} + {??? (235), count=153} + {NOT, count=306} + {'v' (118), count=153} + {NOT, count=610} + {??? (239), count=152} + {NOT, count=304} + {'s' (115), count=152} + {NOT, count=1213} + {??? (149), count=151} + {NOT, count=302} + {??? (139), count=151} + {NOT, count=603} + {'$' (36), count=151} + {NOT, count=301} + {??? (184), count=150} + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 3 +Building encoding map ... + 0: '\0' => 11000 + 1: ??? => 1011001 + 2: ??? => 1011011 + 3: ??? => 01011101 + 4: ??? => 101111111 + 5: ??? => 0100111 + 6: ??? => 101110100 + 7: ??? => 01111111 + 8: '\b' => 101111100 + 9: '\t' => 101101010 + 10: '\n' => 0110000 + 11: ??? => 110111011 + 12: '\f' => 101111101 + 13: '\r' => 111111010 + 14: ??? => 110110101 + 15: ??? => 10011110 + 16: ??? => 100101000 + 17: ??? => 00001010 + 18: ??? => 111100000 + 19: ??? => 111110000 + 20: ??? => 01101 + 21: ??? => 01111000 + 22: ??? => 110110110 + 23: ??? => 00001011 + 24: ??? => 110111100 + 25: ??? => 110111101 + 26: ??? => 00101100 + 27: ??? => 00101110 + 28: ??? => 110100101 + 29: ??? => 01000001 + 30: ??? => 11001111 + 31: ??? => 11011100 + 32: ' ' => 110100001 + 33: '!' => 101001101 + 34: '"' => 100101001 + 35: '#' => 01000100 + 36: '$' => 00000001 + 37: '%' => 101011000 + 38: '&' => 101110101 + 39: ''' => 01100100 + 40: '(' => 01010 + 41: ')' => 101001010 + 42: '*' => 110111111 + 43: '+' => 10110000 + 44: ',' => 101101000 + 45: '-' => 00110101 + 46: '.' => 111100001 + 47: '/' => 00111100 + 48: '0' => 101011001 + 49: '1' => 110111110 + 50: '2' => 110101100 + 51: '3' => 110101101 + 52: '4' => 00110010 + 53: '5' => 10000000 + 54: '6' => 111001001 + 55: '7' => 00001110 + 56: '8' => 101010000 + 57: '9' => 110010000 + 58: ':' => 00111101 + 59: ';' => 111111011 + 60: '<' => 10001000 + 61: '=' => 01001010 + 62: '>' => 10000001 + 63: '?' => 11111100 + 64: '@' => 0010100 + 65: 'A' => 110101110 + 66: 'B' => 100000101 + 67: 'C' => 110110111 + 68: 'D' => 101010001 + 69: 'E' => 00011 + 70: 'F' => 110101000 + 71: 'G' => 10100111 + 72: 'H' => 111100100 + 73: 'I' => 00101111 + 74: 'J' => 100111111 + 75: 'K' => 00101010 + 76: 'L' => 100000100 + 77: 'M' => 111100110 + 78: 'N' => 110010111 + 79: 'O' => 10111001 + 80: 'P' => 1010101 + 81: 'Q' => 111011 + 82: 'R' => 110010001 + 83: 'S' => 111010001 + 84: 'T' => 101001011 + 85: 'U' => 111001101 + 86: 'V' => 00110000 + 87: 'W' => 10110001 + 88: 'X' => 110110010 + 89: 'Y' => 111101101 + 90: 'Z' => 01011110 + 91: '[' => 10001011 + 92: '\' => 111001010 + 93: ']' => 01000101 + 94: '^' => 01111100 + 95: '_' => 10010111 + 96: '`' => 010111001 + 97: 'a' => 110010101 + 98: 'b' => 100101100 + 99: 'c' => 00110110 + 100: 'd' => 101111110 + 101: 'e' => 110111010 + 102: 'f' => 101001100 + 103: 'g' => 01011111 + 104: 'h' => 111010011 + 105: 'i' => 01100010 + 106: 'j' => 01001000 + 107: 'k' => 10101101 + 108: 'l' => 101111010 + 109: 'm' => 01110001 + 110: 'n' => 111100010 + 111: 'o' => 10100100 + 112: 'p' => 100001111 + 113: 'q' => 111001011 + 114: 'r' => 111001110 + 115: 's' => 00000100 + 116: 't' => 111110011 + 117: 'u' => 01110010 + 118: 'v' => 00000110 + 119: 'w' => 01100011 + 120: 'x' => 10111011 + 121: 'y' => 01001101 + 122: 'z' => 00101101 + 123: '{' => 01110101 + 124: '|' => 10111100 + 125: '}' => 10001001 + 126: '~' => 01110100 + 127: ??? => 11111010 + 128: ??? => 0011111 + 129: ??? => 101101001 + 130: ??? => 110101001 + 131: ??? => 00110100 + 132: ??? => 101011111 + 133: ??? => 00110111 + 134: ??? => 111101110 + 135: ??? => 01111001 + 136: ??? => 110101111 + 137: ??? => 111101010 + 138: ??? => 00010 + 139: ??? => 00000010 + 140: ??? => 00100111 + 141: ??? => 01110110 + 142: ??? => 01000010 + 143: ??? => 11010101 + 144: ??? => 100111110 + 145: ??? => 00100010 + 146: ??? => 111101111 + 147: ??? => 111100101 + 148: ??? => 101011110 + 149: ??? => 00000011 + 150: ??? => 111010101 + 151: ??? => 01000000 + 152: ??? => 0101110001 + 153: ??? => 101101011 + 154: ??? => 00111011 + 155: ??? => 111110001 + 156: ??? => 100101101 + 157: ??? => 01001100 + 158: ??? => 00111000 + 159: ??? => 11010001 + 160: ??? => 1100110 + 161: ??? => 110110000 + 162: ??? => 111000 + 163: ??? => 00100011 + 164: ??? => 111111100 + 165: ??? => 111110110 + 166: ??? => 111001111 + 167: ??? => 01111010 + 168: ??? => 110110011 + 169: ??? => 111100111 + 170: ??? => 110100100 + 171: ??? => 01001011 + 172: ??? => 111111101 + 173: ??? => 01100110 + 174: ??? => 10101110 + 175: ??? => 11001001 + 176: ??? => 100001110 + 177: ??? => 111111110 + 178: ??? => 111010000 + 179: ??? => 00110001 + 180: ??? => 10010001 + 181: ??? => 10010010 + 182: ??? => 111111111 + 183: ??? => 10001100 + 184: ??? => 00000000 + 185: ??? => 01001001 + 186: ??? => 01011011 + 187: ??? => 111110111 + 188: ??? => 01100101 + 189: ??? => 00111010 + 190: ??? => 10011100 + 191: ??? => 10010000 + 192: ??? => 111010100 + 193: ??? => 110110001 + 194: ??? => 00101011 + 195: ??? => 10011101 + 196: ??? => 10010011 + 197: ??? => 10001101 + 198: ??? => 01110111 + 199: ??? => 10100001 + 200: ??? => 110010110 + 201: ??? => 110100110 + 202: ??? => 110100000 + 203: ??? => 111101000 + 204: ??? => 101110000 + 205: ??? => 111110010 + 206: ??? => 111001100 + 207: ??? => 10001110 + 208: ??? => 111101011 + 209: ??? => 00001111 + 210: ??? => 01111101 + 211: ??? => 10000101 + 212: ??? => 01110011 + 213: ??? => 00100110 + 214: ??? => 01000110 + 215: ??? => 01100111 + 216: ??? => 101111011 + 217: ??? => 110110100 + 218: ??? => 10100000 + 219: ??? => 111101001 + 220: ??? => 111101100 + 221: ??? => 01000111 + 222: ??? => 01011010 + 223: ??? => 10011000 + 224: ??? => 01111110 + 225: ??? => 11001110 + 226: ??? => 11101011 + 227: ??? => 10001111 + 228: ??? => 110100111 + 229: ??? => 101110001 + 230: ??? => 111001000 + 231: ??? => 01000011 + 232: ??? => 00110011 + 233: ??? => 10001010 + 234: ??? => 10000011 + 235: ??? => 00000111 + 236: ??? => 111010010 + 237: ??? => 10011001 + 238: ??? => 00100000 + 239: ??? => 00000101 + 240: ??? => 0010010 + 241: ??? => 0101100 + 242: ??? => 111100011 + 243: ??? => 00100001 + 244: ??? => 10000100 + 245: ??? => 10000110 + 246: ??? => 10010101 + 247: ??? => 01110000 + 248: ??? => 1001101 + 249: ??? => 110010100 + 250: ??? => 00111001 + 251: ??? => 01111011 + 252: ??? => 0000100 + 253: ??? => 10101001 + 254: ??? => 0000110 + 255: ??? => 1010001 + 256: EOF => 0101110000 +257 character encodings found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? q +Exiting. diff --git a/labb6/res/output/expected-output-8.txt b/labb6/res/output/expected-output-8.txt new file mode 100755 index 0000000..295e890 --- /dev/null +++ b/labb6/res/output/expected-output-8.txt @@ -0,0 +1,189 @@ +Welcome to TDDD86 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. + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 1 +Read from a s)tring or f)ile? f +File name to process: empty.txt +Building frequency table ... + 256: EOF => 1 +1 character frequencies found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 2 +Building encoding tree ... +{EOF (256), count=1} + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 3 +Building encoding map ... + 256: EOF => +1 character encodings found. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? 4 +Reuse your previous string/file data for encoding? y +Encoding data ... +Here is the binary encoded data (0 bytes): + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? c +Input file name: empty.txt +Output file name (Enter for empty.huf): empty.huf +Reading 0 uncompressed bytes. +Compressing ... +Wrote 7 compressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? b +File name to display: empty.huf +Here is the binary encoded data (7 bytes): +11011110 01001100 10101100 01101100 01011100 10001100 10111110 + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? d +Input file name: empty.huf +Output file name (Enter for empty-out.txt): empty-out.txt +Reading 7 compressed bytes. +Decompressing ... +Wrote 0 decompressed bytes. + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? t +File name to display: empty-out.txt +Here is the text data (0 bytes): + + +1) build character frequency table +2) build encoding tree +3) build encoding map +4) encode data +5) decode data + +C) compress file +D) decompress file +F) free tree memory + +B) binary file viewer +T) text file viewer +S) side-by-side file comparison +Q) quit + +Your choice? q +Exiting. |
