Dictionary-Based Compression (LZW)
Part of Compression — GCSE 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)