Introduction - If you have any usage issues, please Google them yourself
Huffman code translator:
Using Huffman code for communication can greatly improve channel utilization, shorten information transmission time, and reduce transmission cost. However, this requires a coding system to preencode the data in the sending end and decoding the incoming data at the receiving end (recovery). For duplex channels (i.e. channels that can transmit information both ways), each end requires a complete code/decoding system. Try to write a Huffman code/decoding system for such a message transceiver.
[basic requirements] a complete system should have the following functions:
(1) I: Initialization. Read the character set size n from the terminal, and n characters and n weights, build the haffman tree, and store it in the file hfmTree.
(2) E: Encoding. Use the built Huffman tree (read from file hfmTree, if not memory), code the body of the file ToBeTran, and then deposit the results in the file CodeFile.
(3) D: Decoding. Using the built Huffman tree to decode the code in CodeFile, the result is stored in the file TextFile.
(4) P: Print. The file CodeFile is displayed in a compact format on the terminal, 50 code per line. Write the encoding file of this character in the file CodePrin at the same time.
(5) T: Tree printing. The haffman tree in memory is displayed in an intuitive manner (tree or concave entry form), and a Huffman tree in the form of this character is written to the file TreePrint.
Packet : 5956473200430481.rar filelist
200430481\cdnlog.txt
200430481\cmd.txt
200430481\CodeFile.txt
200430481\Codeprint.txt
200430481\hffgui$1.class
200430481\hffgui$ButtonListener.class
200430481\hffgui.class
200430481\hffgui.java
200430481\hfmTree.txt
200430481\huffgui$1.class
200430481\huffgui$ButtonListener.class
200430481\huffgui$MyCanvas.class
200430481\huffgui.class
200430481\huffgui.java
200430481\Huffman.class
200430481\Huffman.java
200430481\huffmanTree.class
200430481\leaf.class
200430481\MyCanvas.class
200430481\Rehuffman.class
200430481\Rehuffman.java
200430481\structure\AbstractIterator.class
200430481\structure\AbstractIterator.java
200430481\structure\AbstractLinear.class
200430481\structure\AbstractLinear.java
200430481\structure\AbstractList.class
200430481\structure\AbstractList.java
200430481\structure\AbstractListIterator.java
200430481\structure\AbstractMap.java
200430481\structure\AbstractQueue.class
200430481\structure\AbstractQueue.java
200430481\structure\AbstractSet.java
200430481\structure\AbstractStack.class
200430481\structure\AbstractStack.java
200430481\structure\AbstractStructure.class
200430481\structure\AbstractStructure.java
200430481\structure\AppendableList.java
200430481\structure\ArrayIterator.java
200430481\structure\Assert.class
200430481\structure\Assert.java
200430481\structure\Association.java
200430481\structure\BinarySearchTree.java
200430481\structure\BinaryTree.class
200430481\structure\BinaryTree.java
200430481\structure\BitSet.java
200430481\structure\BTInorderIterator.class
200430481\structure\BTInorderIterator.java
200430481\structure\BTLevelorderIterator.class
200430481\structure\BTLevelorderIterator.java
200430481\structure\BTPostorderIterator.class
200430481\structure\BTPostorderIterator.java
200430481\structure\BTPreorderIterator.class
200430481\structure\BTPreorderIterator.java
200430481\structure\ChainedHashtable.java
200430481\structure\ChainedHashtableIterator.java
200430481\structure\CharSet.java
200430481\structure\CircularList.class
200430481\structure\CircularList.java
200430481\structure\CircularListIterator.class
200430481\structure\CircularListIterator.java
200430481\structure\Clock.java
200430481\structure\ComparableAssociation.java
200430481\structure\ComparableEdge.java
200430481\structure\copyright.html
200430481\structure\DoublyLinkedList.java
200430481\structure\DoublyLinkedListElement.java
200430481\structure\DoublyLinkedListIterator.java
200430481\structure\Edge.java
200430481\structure\Entry.java
200430481\structure\FailedAssertion.class
200430481\structure\FailedAssertion.java
200430481\structure\FailedInvariant.class
200430481\structure\FailedInvariant.java
200430481\structure\FailedPostcondition.class
200430481\structure\FailedPostcondition.java
200430481\structure\FailedPrecondition.class
200430481\structure\FailedPrecondition.java
200430481\structure\Graph.java
200430481\structure\GraphList.java
200430481\structure\GraphListAIterator.java
200430481\structure\GraphListDirected.java
200430481\structure\GraphListEIterator.java
200430481\structure\GraphListUndirected.java
200430481\structure\GraphListVertex.java
200430481\structure\GraphMatrix.java
200430481\structure\GraphMatrixDirected.java
200430481\structure\GraphMatrixUndirected.java
200430481\structure\GraphMatrixVertex.java
200430481\structure\Hashtable.java
200430481\structure\HashtableIterator.java
200430481\structure\index.html
200430481\structure\KeyIterator.java
200430481\structure\Linear.class
200430481\structure\Linear.java
200430481\structure\List.class
200430481\structure\List.java
200430481\structure\Map.java
200430481\structure\MapList.java
200430481\structure\Matrix.java
200430481\structure\MergeableHeap.java
200430481\structure\NaturalComparator.class
200430481\structure\NaturalComparator.java
200430481\structure\OrderedList.class
200430481\structure\OrderedList.java
200430481\structure\OrderedMap.java
200430481\structure\OrderedStructure.class
200430481\structure\OrderedStructure.java
200430481\structure\OrderedVector.java
200430481\structure\package.html
200430481\structure\PriorityQueue.java
200430481\structure\PriorityVector.java
200430481\structure\Queue.class
200430481\structure\Queue.java
200430481\structure\QueueArray.java
200430481\structure\QueueList.class
200430481\structure\QueueList.java
200430481\structure\QueueVector.java
200430481\structure\ReadStream.class
200430481\structure\ReadStream.java
200430481\structure\RedBlackIterator.java
200430481\structure\RedBlackSearchTree.java
200430481\structure\RedBlackTree.java
200430481\structure\ReverseComparator.java
200430481\structure\Set.java
200430481\structure\SetList.java
200430481\structure\SetVector.java
200430481\structure\SinglyLinkedList.class
200430481\structure\SinglyLinkedList.java
200430481\structure\SinglyLinkedListElement.class
200430481\structure\SinglyLinkedListElement.java
200430481\structure\SinglyLinkedListIterator.class
200430481\structure\SinglyLinkedListIterator.java
200430481\structure\SkewHeap.java
200430481\structure\SplayTree.java
200430481\structure\SplayTreeIterator.java
200430481\structure\Stack.class
200430481\structure\Stack.java
200430481\structure\StackArray.java
200430481\structure\StackList.class
200430481\structure\StackList.java
200430481\structure\StackVector.java
200430481\structure\StructCollection.class
200430481\structure\StructCollection.java
200430481\structure\Structure.class
200430481\structure\Structure.java
200430481\structure\Table.java
200430481\structure\ValueIterator.java
200430481\structure\Vector.java
200430481\structure\VectorHeap.java
200430481\structure\VectorIterator.java
200430481\structure\Version.java
200430481\structure\Vertex.java
200430481\structure
200430481