Memory & StorageKey Facts

Dictionary-Based Compression (LZW)

Part of CompressionGCSE Computer Science

This key facts covers Dictionary-Based Compression (LZW) within Compression for GCSE Computer Science. Revise Compression in Memory & Storage for GCSE Computer Science with 15 exam-style questions and 16 flashcards. This topic appears regularly enough that it should still be part of a steady revision cycle. It is section 5 of 11 in this topic. Use this key facts to connect the idea to the wider topic before moving on to questions and flashcards.

Topic position

Section 5 of 11

Practice

15 questions

Recall

16 flashcards

Dictionary-Based Compression (LZW)

How Dictionary Compression Works:

Build a dictionary of common patterns/phrases. Replace patterns with short codes.

Simple Example:

  Text: "the cat sat on the mat the rat sat"
  
  Dictionary:
  1 = "the "
  2 = "sat "
  3 = "at "
  
  Compressed: "1cat 2on 1m31r32"
  
  Original: 33 characters
  Compressed: ~17 characters + dictionary
  

Real Applications:

  • ZIP files: Uses LZ77/DEFLATE algorithm
  • GIF images: Uses LZW for color table compression
  • PDF files: Text and object compression
  • Works best: Text files, code, HTML (lots of repeated words/patterns)

Keep building this topic

Read this section alongside the surrounding pages in Compression. That gives you the full topic sequence instead of a single isolated revision point.

Practice Questions for Compression

Which statement correctly describes lossy compression?

  • A. The original file can be perfectly restored after decompression.
  • B. Data is permanently removed and the original cannot be exactly recreated.
  • C. The compressed file is always the same size as the original.
  • D. No data is removed during the compression process.
1 markfoundation

Explain how run-length encoding (RLE) works to compress data.

3 marksstandard

Quick Recall Flashcards

Want to test your knowledge?

PrepWise has 15 exam-style questions and 16 flashcards for Compression — with adaptive difficulty and instant feedback.

Join Alpha