in Algorithms retagged by
2,498 views
2 votes
2 votes

in Algorithms retagged by
2.5k views

4 Comments

@gabbar bro how u calculated miniumum and maximum no of comparision?
0
0
there is n1 and n2 characters total  n1+n2
worst case : n-1 comparison
Best case : n1 comparisons

 i.e. n1=5 and n2=9   worst case=5+9-1 Best case=5
Build Huffman Tree and each stage calculate comparisons.
THis way i have done ! not sure
0
0
i think the algorithm of OPTIMAL MERGE PATTERN will play some role here
0
0

1 Answer

3 votes
3 votes
Best answer

construct huffman tree max number of comparisions nothing but max heights of the tree

min number of comparisions nothing but min height.(like no comparisions in a b-tree)

selected by

2 Comments

bro i think its 4-1=3
0
0
how is minimum number of comparisons equal to 2?
0
0