Full binary tree with full two fork tree

Source: Internet
Author: User

To write a lot, each of the themes that have been on the binary tree, most of which are in the full binary tree, in the heart of Costa Rica completely however the binary tree has been very vague in form, because I am completely confused with binary and full two fork trees. In fact, a two-prong tree is a special case of a two-fork tree, completely due to a full two-fork tree. Although not entirely representative of the whole. So, you should imagine shaping it, with two children in every node outside. And the whole meaning is that the last layer is not full, and not full.


The following stickers define:

Full binary tree with two forks:

except for the last layer, no matter what .Nodeoutside. All nodes on each layer have two sub-nodes (nodes with no sub-nodes on the last layer areLeaf knot Point). It is also possible to understand that all nodes except leaf nodes have two sub-nodes. The number of nodes reaches the maximum value. All leaf nodes must be on the same layer.


A tree depth is H, the maximum number of layers is k, and the depth is the same as the maximum number of layers. K=h;

the number of its leaves is: 2^hthe number of nodes in Layer K is: 2^ (k-1)Summary points are: 2^k-1 (2 of the K-square minus one)The total number of nodes must be odd.



Completely binary tree (complete binary trees)

If you set the depth of the two-fork tree to H. In addition to layer H, the nodes of the other layers (1~h-1) reach the maximum number, and all nodes of the H layer are continuously concentrated on the leftmost side. This is the totally binary tree.

a completely binary tree is a tree of two forks .

For a depth of K, a two-fork tree with n nodes is called a fully binary tree if and only if its nodes are numbered from 1 to n nodes one by one in a full two-ary tree with a depth of K. If a binary tree has at most only the following two levels of the node on the degree can be less than 2. And the bottom-most nodes are concentrated on the leftmost number of positions on the layer. Then this binary tree becomes completely binary tree.

Hoffman: Do you want each node to have no child nodes, or two child nodes



See the following topics:

A completely binary tree has 770 nodes. Then its leaf node is

2,591

Full binary tree with full two fork tree

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.