Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Data Structures - Create a binary tree

jackjack
jackjack 


Assignment details are attached with starter files. Detailed explanation of the solution would be extremely helpful! thanks. Attachments Tags
Clarifications

Answers

Huffman Coding, DataStructures, BinaryTree - Solution

mariobeka
mariobeka 



In the zip file you'll find the full working Huffman coding implementation as requested per specification, with comments throughout the code for better understanding. Attachments
HW2.zip (78 K) Download
Preview
originalUncompressedSize += value; } // to convert it to bits we multiply it by 8 originalUncompressedSize = originalUncompressedSize * 8; int compressedSize = 0; // Get the total bits of new encoded text. for (String s : encoding.values()) { compressedSize

Preview
codes when leaves are traversed. */ private void traverse(String currentCode, HashMap<Character, String> curMappings) { //Associate each leaf's value with its Huffman code. if (left == null && right == null) { curMappings.put(value, currentCode); } if (left != null) { left.traverse(currentCode + "0", curMappings); } if (right != null) { right.traverse(currentCode

Preview
} Map<Character, String> encoding = Huffman.getEncoding(frequencies); // You can delete this for-loop as well. This is just to show the encoding process. for (Map.Entry entry : encoding.entrySet())

Preview
That else leans on the affair: pray you, make haste. [Exeunt Rosencrantz and Guildenstern.] And, England, if my love thou hold'st at aught,-- As my great power thereof may give thee sense, Since yet thy cicatrice looks raw and red After the Danish sword, and thy free awe

Screenshots
Purchase Answer