Search code examples
javaclass-diagram

Huffman coding UML diagram


I wrote a huffman code and it has 5 classes: huffcode, leaf, node, tree and main. I have to create a uml diagram for this program. I already created the diagram for leaf, node and tree. But I dont know what relationship huffcode has with other class. My huffcode class has all the instruction to make the huffman code. Inputs String is parsed from the main to this class. There are methods in huffcode to take inputs create leaves, then nodes. Well, in short, all the instruction for the huffman coding is in huffcode. What kind of relationship does this class have with the other class? Also, my priority queue is created in huffcode.


Solution

  • Uses Composite pattern from Gof. It will help you to write the diagram of huffmans algorithm. Good luck!!!