Data Compression Algorithms Flashcards
(7 cards)
What is lossless compression?
A data compression method that allows the original data to be perfectly reconstructed from the compressed data (e.g., ZIP, PNG). Ideal for text or data where accuracy is critical.
You need to compress a high-resolution image for a website while maintaining a small file size. Which compression method should you use: Lossy or Lossless?
Lossy compression (e.g., JPEG), as it significantly reduces file size by discarding some data, which is acceptable for images viewed online.
Describe how Huffman Coding compresses data.
Huffman Coding assigns shorter binary codes to more frequently used characters, creating an optimized prefix tree to reduce file size.
What is a trade-off of using lossy compression for audio files?
Reduces file size significantly but results in a loss of sound quality, which may affect the listening experience.
What is Run-Length Encoding (RLE)?
A compression method that replaces consecutive repeated characters with a single character and a count (e.g., “AAAA” becomes “A4”).
Lossy vs. Lossless: Which is better for compressing a document? Why?
Lossless, because documents require exact data recovery, and lossy compression would result in data loss.
What is a key drawback of lossy compression?
The original data cannot be perfectly restored, leading to a potential loss in quality (e.g., audio fidelity).