huffman encoding

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/16

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

17 Terms

1
New cards

what used for

lossless compression

2
New cards

what determines huffman code

frequency

lower frequency = longer code

3
New cards

left edge label

0

4
New cards

right edge label

1

5
New cards

how is character code determined

path from root to leaf, concatenate 0 and 1

6
New cards

are huffman code prefix free

yes

7
New cards

what is stored at leaves of trees

actual characters

8
New cards

what is stored at internal nodes

combined frequencies of nodes (sums)

9
New cards

what if two chars have the same freq

can go left/right, multiple valid trees

10
New cards

is the 0s and 1s adding binary, or simply concatenating

simply concatenating, has no actual binary value

11
New cards

what does the most frequent character get as a code

the shortest code

12
New cards

what is the huffman code for a node that is all right children

string of 1s

13
New cards

can a characters code ever be 0

yes, if its the only character

14
New cards

what happens if forget to reconstruct the tree for decoding?

cannot recode. prefix map is not enough

15
New cards

during decoding, when is char outputted

when reach a leaf

16
New cards

can huffman encoding produce the same output for multiple trees

yes, if codes are same regardless of structure

17
New cards

what if you treat huffman codes as binary numbers

you get NOTHING. you LOSE. good DAY SIR.