2 votes 2 votes Algorithms huffman-code algorithms test-series + – jenny101 asked Oct 26, 2016 • retagged Jul 16, 2022 by makhdoom ghaya jenny101 2.5k views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Amit puri commented Oct 27, 2016 reply Follow Share @gabbar bro how u calculated miniumum and maximum no of comparision? 0 votes 0 votes papesh commented Oct 27, 2016 reply Follow Share 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 votes 0 votes Aboveallplayer commented Oct 27, 2016 reply Follow Share i think the algorithm of OPTIMAL MERGE PATTERN will play some role here 0 votes 0 votes Please log in or register to add a comment.
Best answer 3 votes 3 votes 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) santhoshdevulapally answered Oct 31, 2016 • selected Nov 6, 2017 by santhoshdevulapally santhoshdevulapally comment Share Follow See all 2 Comments See all 2 2 Comments reply pavanmahaveer commented Sep 5, 2018 reply Follow Share bro i think its 4-1=3 0 votes 0 votes akshay7797 commented Oct 5, 2019 reply Follow Share how is minimum number of comparisons equal to 2? 0 votes 0 votes Please log in or register to add a comment.