Huffman Codes
Huffman Codes 1: Introduction
questions1 = [
{
time: "1:18",
question: "How many bits would you use?",
answers: [
"1",
"2",
"3",
"4",
"5",
],
correct: 4
},
{
time: "2:56",
question: "How many bits does it take to store 100 characters?",
answers: [ ],
correct: "200"
},
{
time: "4:06",
question: "What does 001 encode?",
answers: [
"AB",
"CD",
"AAD",
"Cannot be determined",
],
correct: 3
},
]
yt1 = new YtQuiz("UIYehpYcTbo", questions1);
yt1.html();
Huffman Codes 2: Prefix-Free Encodings
Huffman Codes 3: Binary Tree Representation
Huffman Codes 4: Merging Trees
questions4 = [
{
time: "2:25",
question: "How many times were D and A involved in a merge, respectively?",
answers: [
"2 and 2",
"1 and 2",
"2 and 1",
],
correct: 2
},
{
time: "3:01",
question: "Which two nodes should we merge fist?",
answers: [
"The two with the highest frequencies",
"The two with the lowest frequencies",
"It does not matter"
],
correct: 1
},
]
yt4 = new YtQuiz("zCEWSy3DV3c", questions4);
yt4.html();
Huffman Codes 5: Huffman’s Algorithm
Huffman Codes 6: Running Time
questions6 = [
{
time: "0:13",
question: "How long does it take to construct the forest?",
answers: [
"O(1)",
"O(n)",
"O(n^2)",
],
correct: 1
},
{
time: "0:28",
question: "How many times does the loop iterate?",
answers: [
"O(1)",
"O(lg n)",
"O(n)",
],
correct: 2
},
]
yt6 = new YtQuiz("oBi9qed0l78", questions6);
yt6.html();