Huffmann algorith implementation.