In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
In this issue, the editor will bring you what are the basic forms of binary tree. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
There are five basic forms of binary tree, namely: 1, empty binary tree; 2, binary tree with only one root node; 3, only left subtree; 4, only right subtree; 5, complete binary tree.
There are five basic forms of binary tree
1) empty binary tree: empty tree
2) A binary tree with only one root node: a tree with only root, that is, a single node
3) only the left subtree: has roots and has a left subtree
4) only the right subtree: has roots and has a right subtree
5) complete binary tree: has roots and has a left subtree and a right subtree.
Special types:
1. Full binary tree: if a binary tree has only a node with degree 0 and a node with degree 2, and the node with degree 0 is on the same layer, then the binary tree is full binary tree.
2. Complete binary tree: a binary tree with depth k and n nodes if and only if each node corresponds to the nodes numbered from 1 to n in the full binary tree with depth k and n nodes.
The characteristic of the complete binary tree is that the leaf node can only appear on the two largest layers of the sequence, and the maximum sequence of the offspring under the left branch of a node is equal to or larger than that of the offspring under the right branch.
Binary tree (Binary tree) is an important type of tree structure. The data structures abstracted from many practical problems are often in the form of binary trees, even ordinary trees can be simply converted into binary trees, and the storage structure and algorithms of binary trees are relatively simple, so binary trees are particularly important. The characteristic of binary tree is that each node can only have two subtrees at most, and there is a difference between left and right.
A binary tree is a set of n finite elements, which is either empty or composed of an element called root and two disjoint binary trees called left subtree and right subtree, respectively. When the set is empty, the binary tree is called empty binary tree. In a binary tree, an element is also called a node
The above is the basic form of the binary tree shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.