2 2 votes Q29. 4. A file contains the following characters and their corresponding frequencies as shown below: \[ \mathrm{a}: 45, \mathrm{~b}: 13, \mathrm{c}: 12, \mathrm{~d}: 16, \mathrm{e}: 9, \mathrm{f}: 5 \] If we use Huffman coding for data comparisons, what is the difference between maximum and minimum number of comparisons? Algorithms huffman-code algorithms test-series + – jenny101 3.4k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply papesh commented Oct 26, 2016 reply Follow flag 136?? 0 0 replyShare Dharmendra Prasad commented Oct 26, 2016 reply Follow flag Here is a post which explaing Huffman Coding. May be once you understand the concept, you can find it for yourself :) http://techieme.in/huffman-decoding/ 0 0 replyShare janakyMurthy commented Oct 26, 2016 reply Follow flag could you please explain how you calculated that? 0 0 replyShare Amit puri commented Oct 27, 2016 reply Follow flag @gabbar bro how u calculated miniumum and maximum no of comparision? 0 0 replyShare papesh commented Oct 27, 2016 reply Follow flag 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 replyShare Aboveallplayer commented Oct 27, 2016 reply Follow flag i think the algorithm of OPTIMAL MERGE PATTERN will play some role here 0 0 replyShare Please log in or register to add a comment.
Best answer 3 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 2 2 Comments reply pavanmahaveer commented Sep 5, 2018 reply Follow flag bro i think its 4-1=3 0 0 replyShare akshay7797 commented Oct 5, 2019 reply Follow flag how is minimum number of comparisons equal to 2? 0 0 replyShare Please log in or register to add a comment.