1 votes 1 votes From huffmann encoding how will we find max and min number of comparisons? what will be the max and min comparisons here A_i_$_h asked Nov 14, 2017 A_i_$_h 196 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Red_devil commented Nov 14, 2017 reply Follow Share 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 1 votes 1 votes A_i_$_h commented Nov 14, 2017 reply Follow Share @red i understood the minimum ...... Can u explain max in a bit more detailed way 0 votes 0 votes Red_devil commented Nov 15, 2017 reply Follow Share Well how can you get a max number of comparisons?? only if you include the higher weights(sort them in decresing order) maximum numbers of time in calculations and this is posible only when you use them in leaf nodes. 0 votes 0 votes Please log in or register to add a comment.