Huffman Tree Learning

Source: Internet
Author: User

Basic concepts:

1. A path is a branching sequence from one node to another, and the path length refers to the number of branches that pass from one node to another node.

2, in real life, we give each node the actual meaning of the real number, called the real number is the right node . In the tree structure, the path length of the root to a node is called the weighted path length of the node.

3. the length of the tree's weighted path is the sum of the length of the weighted path of all the leaf nodes in the tree.

For example, the weights of C are 7,5,2,4 respectively. Path length is the number of layers-1 that is, the length of the root node

Huffman Tree :

Huffman Tree is also called the optimal binary tree, which is composed of n-weighted leaf nodes of all the two-fork tree with a weighted path length WPL the shortest two-fork tree.

The structure of Huffman tree:

Hover slow coding, computer instructions, etc. if you want to achieve the variable length encoding must satisfy: any one encoding can not be the prefix of other encodings, the encoding to meet this condition is called prefix encoding .

Using the Harley Slow tree code:

  

Huffman Tree Learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.