Implement makeHuffmanTree