testhuffman.java

来自「这是一个huffmanCode算法」· Java 代码 · 共 37 行

JAVA
37
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package lab6;/** * * @author Administrator */import java.io.IOException;public class TestHuffman {	public static void main(String[] args) throws IOException {		/* Process the input source file */		FileProcess fp = new FileProcess();		fp.processFile("HugeFile.html");		/* Three cases: "TinyFile.html", "MidFile.html" and "HugeFile.html" */				/* Get the frequency of each character */		int[] freqArray = fp.getFreq();				/* Initialize a new HuffmanTree */		HuffmanTree tree = new HuffmanTree();				/* Generate the HuffmanTree according to the pass-in frequency */		tree.HUFFMAN(freqArray);		/* Print out the resulting representation */		tree.printHuffmanTree();	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?