Huffman coding

Juan Francisco Rodríguez Herrera
Vicente González Ruiz

July 10, 2017

Contents

1 Introduction
2 Algorithm to build the Huffman tree

1 Introduction

2 Algorithm to build the Huffman tree

  1. Create a list of nodes. Each node stores a symbol and its probability.
  2. While the number of nodes in the list > 1:
    1. Extract from the list the 2 nodes with the lowest probability.
    2. Insert in the list a new node (that is the root of a binary tree) whose probability is the sum of the probability of its leafs.

Example

PIC

References

[1]   D.A. Huffman. A Method for the Construction of Minimum Redundancy Codes. Proceedings of the Institute of Radio Engineers, 40:1098–1101, 1952.