"Aha algorithm"--tree

Source: Internet
Author: User
Tags abstract tree

This article begins with a discussion of some simple concepts and algorithms for the "tree".

Tree is a basic data structure, the reason is called the tree is derived from the bionic-branch bifurcation structure or the structure of the root fork, it is very good to express the logical relationship between the nodes, it is also a very important structure of graph theory. From the point of view of its name, we find that much of the growth of scientific thinking stems from a keen observation of nature, which provides a very good method for researchers.

We observe the tree structure of nature, it is easy to find that no tree of two branches grow together, and the abstract tree structure is so, from the root node, a path farther and deeper, there is no loop, based on this nature, we can push out many other characteristics of the tree.

1. Each of the two nodes in a tree has and only one path is connected. (Obviously, if this is not the case, it will produce a loop)

2. If a tree has n nodes, it happens to have n-1 edges.

3. Adding an edge to a tree will form a loop.

Tree-based abstract model, we actually use this structure in all aspects of life, such as the genetic pedigree of the organism, the organization composition of the company, the catalogue of books, the Match of the World Cup football team, etc., through this basic data structure, we can make the life of a lot of messy data organized, logical and form a system, This is the abstraction of things to our real life brought about by the traversal, but also our scientific knowledge of the original intention.

"Aha algorithm"--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.