well i think we can do this way but i havent used any formula regarding huffman code

it is like merging the files,,if you have lower no. of element in the leafs then there will be less number of comparisons because you are doing comparisons equal to height of the tree,

as we know no of comparisons for two groups of element having n and m element are n+m-1

so at each merging point we have given the sum of below nodes so just minus one from each node and add them so you will get 219 comparisons it is minimum and for max just interchange the node of higher weights to lower leaf =362 comparisons

it is like merging the files,,if you have lower no. of element in the leafs then there will be less number of comparisons because you are doing comparisons equal to height of the tree,

as we know no of comparisons for two groups of element having n and m element are n+m-1

so at each merging point we have given the sum of below nodes so just minus one from each node and add them so you will get 219 comparisons it is minimum and for max just interchange the node of higher weights to lower leaf =362 comparisons