Introduction - If you have any usage issues, please Google them yourself
Huffman tree construction, assuming there are n weights, Huffman tree is constructed with n leaf nodes. n-weights are set to w1, w2, ..., wn, the Huffman tree construction rules: (1) w1, w2, ..., wn as a forest of n trees (each tree only There is a node) (2) selected in the forest root weights two smallest trees combined, as a new tree to the left and right sub-tree, and the new root of the tree is the left-right and right sub-tree root and the right value (3) selected from the forest to remove two trees, and adding a new tree forest (4) repeat (2), (3) steps, until only the forest a tree until the tree is obtained by the Huffman tree.