diff --git a/Spring-2023/CS-2124/Assignment-3/README.org b/Spring-2023/CS-2124/Assignment-3/README.org index be71bd5..22fdb2d 100644 --- a/Spring-2023/CS-2124/Assignment-3/README.org +++ b/Spring-2023/CS-2124/Assignment-3/README.org @@ -1,4 +1,4 @@ -* Assignment 2 +* Assignment 3 - ABC123: =zfp106= - Name: =Price Hiller= @@ -53,3 +53,37 @@ Create a Huffman Encoding Table and Tree for your first or last name b. Variable bit representation c. Highlight which Huffman bit representation requires less bits for encoding i.e. Fixed bit representation or variable bit representation, just like in the lecture slides + +**** Tables + +- Fixed bit representation + | Character | Bits | Frequency | Number of Bits Used | + |-----------|------|-----------|---------------------| + | P | 000 | 1 | 3 | + | r | 001 | 1 | 3 | + | i | 010 | 1 | 3 | + | c | 011 | 1 | 3 | + | e | 100 | 1 | 3 | + + Total Number of Bits Used: $15$ + +- Variable bit representation + | Character | Bits | Frequency | Number of Bits Used | + |-----------|------|-----------|---------------------| + | P | 00 | 1 | 2 | + | r | 01 | 1 | 2 | + | i | 110 | 1 | 3 | + | c | 111 | 1 | 3 | + | e | 10 | 1 | 2 | + + Total Number of Bits Used: /*_~12~_*/ + + /*Fewer bits used for variable bit representation!*/ + +**** Trees + +- Fixed bit representation + [[./assets/PartTwo/fixed-bits-huffman.png]] +- Variable bit representation + [[./assets/PartTwo/variable-bits-huffman.png]] + diff --git a/Spring-2023/CS-2124/Assignment-3/assets/PartTwo/fixed-bits-huffman.png b/Spring-2023/CS-2124/Assignment-3/assets/PartTwo/fixed-bits-huffman.png new file mode 100644 index 0000000..7a6bb24 Binary files /dev/null and b/Spring-2023/CS-2124/Assignment-3/assets/PartTwo/fixed-bits-huffman.png differ diff --git a/Spring-2023/CS-2124/Assignment-3/assets/PartTwo/variable-bits-huffman.png b/Spring-2023/CS-2124/Assignment-3/assets/PartTwo/variable-bits-huffman.png new file mode 100644 index 0000000..d7ce4f8 Binary files /dev/null and b/Spring-2023/CS-2124/Assignment-3/assets/PartTwo/variable-bits-huffman.png differ