• Home
  • Textbooks
  • Data Structures and Algorithms in C++
  • DATA COMPRESSION

Data Structures and Algorithms in C++

Adam Drozdek

Chapter 11

DATA COMPRESSION - all with Video Answers

Educators


Chapter Questions

01:19

Problem 1

For which probabilities $P\left(m_i\right)$ of $n$ symbols is the average length maximal? When is it minimal?

Adriano Chikande
Adriano Chikande
Numerade Educator
01:03

Problem 2

Find $L_{\text {ave }}$ for the letters $X, Y$, and $Z$ and their probabilities $.05, .05$, and .9 and compare it to $L_{\text {Huf }}$ computed for single letters and pairs of letters, as in Figure 11.6. Does $L_{\mathrm{Huf}}$ satisfactorily approximate $L_{\text {ave }}$ ? How can we remedy the problem?

Ashley Volpe
Ashley Volpe
Numerade Educator
01:15

Problem 3

Assess the complexity of all the implementations of the Huffman algorithm suggested in this chapter.

Nick Johnson
Nick Johnson
Numerade Educator

Problem 4

What are the lengths of the Huffman codewords of the least probable messages with respect to each other?

Check back soon!

Problem 5

In the adaptive Huffman algorithm, first the codeword for an encountered symbol is issued and then the conversion table is updated. Could the table be updated first and then the new codeword for this symbol be issued? Why or why not?

Check back soon!

Problem 6

The functions create Code words () and trans form Tree To Array of Lists () used in the case study seem to be vulnerable because the first thing they both do is access the pointer left of node $p$, which would be dangerous if p were null; therefore, the body of both functions should apparently be preceded by the condition if (p $!=0$ ). Explain why this is not necessary.

Check back soon!

Problem 7

What problem arises if, in run-length encoding, triples of the form $\langle c m, n, c h\rangle$ are used instead of triples of the form $\langle\mathrm{cm}, \mathrm{ch}, n\rangle$ ?

Check back soon!
01:28

Problem 8

Explain the significance of putting all probabilities in order before starting the Shannon-Fano method.

Joshua Sieverding
Joshua Sieverding
Numerade Educator
04:19

Problem 9

In Figure $11.10, l_1=l_2=4=2^2$. In what respect does the choice of $l_1=l_2=16=2^4$ simplify the implementation of the LZ77 algorithm?

Lucía Guerrero
Lucía Guerrero
Numerade Educator

Problem 10

In which situation does the LZ77 algorithm perform best? Worst?

Check back soon!

Problem 11

Describe the process of decoding using $L Z 77$. What string is coded by this sequence of codewords: b, $31 \mathrm{a}, 23 \mathrm{~b}, 30 \mathrm{c}, 21 \mathrm{a}, 32 \mathrm{~b}$ ?

Check back soon!

Problem 12

Using LZW with the table initialized with the letters a, b, c, decode the string coded as 124314958122.

Check back soon!