AQA Computer Science GCSE
Data Representation – Compression
Compression involves the reduction in file size of data. Basically finding clever ways to make it smaller.
This is dead handy and makes using the modern internet much easier – iPlayer, Spotify, online multiplayer games, Skype – all of it uses compression to make it possible.
There are two specific methods of compression you need to know about:
- Run Length Encoding
- Huffman Coding
Compression – intro slides
Run Length Encoding
Run Length Encoding is fairly straightforward. In an exam you might see it applied to text but it's more likely that it will be applied to a bitmap image of some kind - quite possibly a black and white bitmap.
Compression and Run Length Encoding – everything you need to know
Run Length Encoding examples – slides from class
RLE summary – single slide
Huffman Coding is more complex - to the extent that it might well appear to be just weird. It uses an idea called a Binary Tree – which is actually used quite widely in all sorts of ways in computing.
The exam board will use Huffman Coding to encode short pieces of text – the chances are they will use a word with no more than 4 or 5 letters in it.
Huffman Coding slides – the slides I use in class
Example Huffman Tree – a Huffman Tree to work through, preferably with a teacher
Huffman Tree questions – the easiest way to learn Huffman Trees is probably to work through some questions