If there are n characters in Huffman Coding then we can build a min heap in nlogn.
then 2 times extract-min will take logn, after that insertion of result will also take logn. and this will be repeated for i=1 to n-1;
So, total complexity will be nlogn.