Edit the RMarkdown source file for this assignment in RStudio. When you finish, Knit the file to HTML and upload the .html
output to Canvas.
| letter | b | l | a | c | k | h | w | s |
| codeword | 01 | 11 | 0010 | 0001 | 0011 | 0000 | 010 | 011 |
10110110100000101
. Is this an optimal code for encoding this data? #
0/ \1
# e
0/ \1
a #
0/ \1
# g
0/ \1
m n
| letter | a | b | c | d | e | f | g | h | i |
| frequency | 100 | 20 | 30 | 20 | 150 | 10 | 20 | 40 | 110 |
24
/ \
21 16
/ \ /
9 18 17
ExtractMax
on a max-heap of \(n\) elements and ExtractMin
on a min-heap of \(n\) elements? (Give an asymptotic estimate.)AddToMaxHeap
and AddToMinHeap
(or equivalently, the running time of Insert
into a priority queue)?