Skip to content
0:00 / 0:00

#huffmancoding#compression#huffmantrees

How Computers Compress Text: Huffman Coding and Huffman Trees

Tom Scott

6.7M subscribers • 28 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Tom Scott

Beginner. No background in the topic needed.

2M views9 years ago2 recommendations

Computer scienceSystems programmingAlgorithmsData structures

Tom Scott explains how Huffman coding and Huffman trees are used to compress text efficiently by using fewer bits for common characters.

Computers store text (or, at least, English text) as eight bits per character. There are plenty of more efficient ways that could work: so why don't we use them? And how can we fit more text into less space? Let's talk about Huffman coding, Huffman trees, and Will Smith. Thanks to the Cambridge Centre for Computing History: computinghistory.org.uk/ Thanks to Chris Hanel at Support Class for the graphics: supportclass.net Filmed by Tomek: youtube.com/tomek And thanks to my proofreading team! 🟥 MORE FROM TOM: tomscott.com/ (you can find contact details and social links there too) ❓ LATERAL, free weekly podcast: lateralcast.com/ youtube.com/lateralcast/ ➕ TOM SCOTT PLUS: youtube.com/tomscottplus 👥 THE TECHNICAL DIFFICULTIES: youtube.com/techdif

Why it's here

2 people recommend this

What people say. Recommended as one of the best explanations of data compression and the Huffman algorithm.

u/BobbyBoiein r/compsci • Recommends

On “How does compression work really?”

check out huffman algorithm: link to this video most of the time this is the main way to compress data, or it have something added on top of it.

u/ScotchEssayThrowawayin r/compsci • Recommends

On “How does compression work really?”

Tom Scott has one of best explanations of compression here.

u/jshakes213in r/C_Programming • Mentions

On “Beginner project”

Here's one thats not bad: Read about Huffman Encoding and try to implement an encoder and decoder that can work on arbitrary files. Look at how much compression you can get on different file types. This is a good video on how it works without giving you any code: link to this video Things to consider would be how will you make your tree, and how will you store it so the decoder can use it. What will you do if your final bit you are encoding or decoding isnt a multiple of a byte , etc Theres lots of other things to do but I had fun with this as a beginner.

u/Pollu_Xin r/C_Programming • Mentions

On “C Hands-On?”

It is a type of lossless compression of text, all I have followed is link to this video and https://en.wikipedia.org/wiki/Huffman_coding?wprov=sfla1