1/16
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
what used for
lossless compression
what determines huffman code
frequency
lower frequency = longer code
left edge label
0
right edge label
1
how is character code determined
path from root to leaf, concatenate 0 and 1
are huffman code prefix free
yes
what is stored at leaves of trees
actual characters
what is stored at internal nodes
combined frequencies of nodes (sums)
what if two chars have the same freq
can go left/right, multiple valid trees
is the 0s and 1s adding binary, or simply concatenating
simply concatenating, has no actual binary value
what does the most frequent character get as a code
the shortest code
what is the huffman code for a node that is all right children
string of 1s
can a characters code ever be 0
yes, if its the only character
what happens if forget to reconstruct the tree for decoding?
cannot recode. prefix map is not enough
during decoding, when is char outputted
when reach a leaf
can huffman encoding produce the same output for multiple trees
yes, if codes are same regardless of structure
what if you treat huffman codes as binary numbers
you get NOTHING. you LOSE. good DAY SIR.