cs-2124: finish part two of assignment 3
This commit is contained in:
parent
2c97b86ab2
commit
9aeef4926c
@ -1,3 +1,15 @@
|
|||||||
|
#+BIND: org-export-filter-strike-through-functions (tmp-f-strike-through)
|
||||||
|
#+BIND: org-export-filter-code-functions (tmp-latex-code-filter)
|
||||||
|
#+BEGIN_SRC emacs-lisp :exports results :results none
|
||||||
|
(defun tmp-latex-code-filter (text backend info)
|
||||||
|
"red inline code"
|
||||||
|
(when (org-export-derived-backend-p backend 'latex)
|
||||||
|
(format "{\\color{red} %s }" text)))
|
||||||
|
#+END_SRC
|
||||||
|
#+latex_header: \usepackage{xcolor}
|
||||||
|
#+BEGIN_SRC emacs-lisp :exports results :results none
|
||||||
|
(defun tmp-f-strike-through (s backend info) "")
|
||||||
|
#+END_SRC
|
||||||
* Assignment 2
|
* Assignment 2
|
||||||
|
|
||||||
- ABC123: =zfp106=
|
- ABC123: =zfp106=
|
||||||
@ -53,3 +65,37 @@ Create a Huffman Encoding Table and Tree for your first or last name
|
|||||||
b. Variable bit representation
|
b. Variable bit representation
|
||||||
c. Highlight which Huffman bit representation requires less bits for encoding i.e. Fixed bit
|
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
|
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]]
|
||||||
|
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
Loading…
x
Reference in New Issue
Block a user