Classical algorithm (v) binary tree & Balance binary tree & red and black tree

Source: Internet
Author: User

Defined:

Tree:

A tree is a finite set t of N (n≥0) nodes, and when n>0 meets the following conditions:
(1) There is only one specific node called root (Root);
(2) When n>1, the remaining nodes can be divided into m (m>0) disjoint finite set T1, T2 、...、 Tm, each set Ti (1≤i≤m) is a tree, and is called the subtree of the tree T (subtree).
In particular, a tree that does not contain any nodes (that is, n=0) is called an empty tree.
Here is the structure of a tree:

  • Ordered tree: If the subtree of each node in the tree is considered to be sequential from left to right (that is, it cannot be interchanged), the tree is called an ordered tree
  • Unordered tree: If the subtree of each node in the tree is considered to be left-to-right (that is, interchangeable), the tree is called an unordered tree

Two-fork Tree:

A binary tree is an ordered tree with a maximum of two children per node and a sub-tree with left and right points

Classical algorithm (v) binary tree & Balance binary tree & red and black 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.