*[the example assignment](https://gitlab.epfl.ch/lamp/cs-210-functional-programming-2019/blob/master/week1/01-example.md) on the development workflow.
*[this guide](https://gitlab.epfl.ch/lamp/cs-210-functional-programming-2019/blob/master/week1/02-grading-and-submission.md) for details on the submission system.
**Make sure to submit your assignment before the deadline written in [README.md](/README.md)**
*[The documentation of the Scala standard library](https://www.scala-lang.org/files/archive/api/2.13.1)
*[The documentation of the Java standard library](https://docs.oracle.com/en/java/javase/11/docs/api/index.html)
## Overview
Huffman coding is a compression algorithm that can be used to
compress lists of characters.
In a normal, uncompressed text, each character is represented by the same number of bits (usually eight).
In Huffman coding, each character can have a bit representation of a different length, depending on how common a character is: the characters that appear often in a text are represented by a shorter bit sequence than those being used more rarely.
Every huffman code defines the specific bit sequences used to represent each character.
A Huffman code can be represented by a binary tree whose leaves represent the characters that should be encoded.
The code tree below can represent the characters `A` to `H`.
The leaf nodes have associated with them a weight which denotes the frequency of appearance of that character.
In the example below, the character `A` has the highest weight 8, while `F` for example has weight 1.
Every branching node of the code tree can be thought of as a set containing the characters present in the leaves below it. The weight of a branching node is the total weight of the leaves below it: this information is necessary for the construction of the tree.