huffman coding

Cards (22)

  • What is Huffman coding used for?
    It is used for data compression
  • How many bits does each character take up without compression?
    8 bits
  • How does Huffman coding assign bit patterns to characters?
    More frequent characters get shorter bit patterns
  • In the word "MISSISSIPPI," how many characters are there?
    11 characters
  • How many times does the character 'm' occur in "MISSISSIPPI"?
    1 time
  • How many times does the character 'i' occur in "MISSISSIPPI"?
    4 times
  • How many times does the character 's' occur in "MISSISSIPPI"?
    4 times
  • How many times does the character 'p' occur in "MISSISSIPPI"?
    2 times
  • What is the size of the compressed file for "MISSISSIPPI"?
    21 bits
  • What is the original file size of "MISSISSIPPI" before compression?
    88 bits
  • What type of compression is Huffman coding?
    Lossless compression
  • The Huffman code is constructed using a binary tree where nodes are assigned values based on their frequency of occurrence.
  • Huffman Coding: The most commonly used lossless compression algorithm.
  • In Huffman coding, symbols with higher frequencies have shorter codes while those with lower frequencies have longer codes.
  • Character 
    Bit pattern 
    -0 
    O -10 
    H -110 
    E -111 
     
    Write down the full bit pattern for the compressed word HELLO. Use the table above to help you with this.  
     110,111,0,0,10 
  • The Huffman tree can be represented as an array or linked list to store the code lengths.
  • 0 left
    1 right
  • file size of compressed file for GEMINI
    14
  • size of compression:
    dividing the size of the compressed file by the original size.
  • file size of compressed = count 0 and 1s
  • ascii
    A=65
    a=97
  • Huffman Coding is used to compress files, especially text-based files like source codes, documents, etc.