Перейти к содержимому

How Does Your Computer Shrink Files by 69% Without Losing Anything?

Konstent

0:00 / 0:00

How Does Your Computer Shrink Files by 69% Without Losing Anything?

241 просмотр · 7 дней назад
Konstent
20 подписчиков
241 просмотр · 7 дней назад
How can a huge file get squeezed into something much smaller… and then come back EXACTLY the same, bit for bit? The answer is Huffman coding, an algorithm created in 1952 by David Huffman, a student at MIT, while working on a class assignment. Today it (or ideas built on it) works quietly inside your zip files, images, music and videos. In this video we build it from nothing, step by step, using one real example message: 368 bits → 115 bits (about 69% smaller) and not a single bit is lost ⏱ CHAPTERS (edit times after final render) 0:00 How can a file shrink and come back exactly the same? 0:00 Who invented Huffman coding? 0:00 Lossless compression explained 0:00 Step 1–2: Count and sort the letters 0:00 Step 3: Build the tree (merge the two smallest) 0:00 Step 4–5: Label branches and read the codes 0:00 Prefix codes: why there's never any confusion 0:00 Step 6–7: Encode and pack the file 0:00 Step 8: Decode by walking the tree 0:00 Cousins: Adaptive, Canonical, Shannon-Fano, Arithmetic coding 📌 You'll learn what lossless compression means how the Huffman tree is built why common letters get short codes and rare letters get long ones how ZIP, gzip and PNG use a canonical version of it how Huffman beat Shannon-Fano, his own professor's method Subscribe to KONSTENT for more algorithms and higher math, explained visually with Manim. #huffmancoding #compression #algorithms #computerscience #manim