Huffman coding in C#

Huffman coding is an encoding algorithm used for data compression. So called Huffman trees are used for encoding and decoding of data. The leaves of these trees contain the symbols and their frequencies. Each parent node contains the sum of the frequencies of its children.

The Huffman tree (with the symbols and their frequencies) is also transmitted with the compressed array of bits. The tree is needed to encode and to decode. However, the original message is not needed to decode.

I just did this as homework. Using array instead of Dictionary is about 5 times faster and when you are trying to process GBs of data it really matters.
I wanted to point it out, because i spent a lot of time today optimizing my code and Dictionary performed terrible.