
Interview: How Does File Compression Work??️
How Zip Files Shrink Without Losing Data!
A 1 GB folder zips down to 400 MB and unzips back to the full 1 GB. The method behind it is Huffman coding. In the word BANANA, A appears three times, N twice and B once, yet a computer spends 8 bits on every letter, 48 bits in total. Huffman gives the most frequent letter the shortest code: A becomes 0, B becomes 10, N becomes 11. The same word now fits in 9 bits, and every letter is still there.
Did you think zip deleted something to save space? Yes or no in the comments.
#HuffmanCoding #DataCompression #ZipFile #ComputerScience #Algorithms #KodeKloud #Programming #TechExplained #BinaryCode #CodingShorts #Shorts
A 1 GB folder zips down to 400 MB and unzips back to the full 1 GB. The method behind it is Huffman coding. In the word BANANA, A appears three times, N twice and B once, yet a computer spends 8 bits on every letter, 48 bits in total. Huffman gives the most frequent letter the shortest code: A becomes 0, B becomes 10, N becomes 11. The same word now fits in 9 bits, and every letter is still there.
Did you think zip deleted something to save space? Yes or no in the comments.
#HuffmanCoding #DataCompression #ZipFile #ComputerScience #Algorithms #KodeKloud #Programming #TechExplained #BinaryCode #CodingShorts #Shorts
KodeKloud
...