Basic Data Structure Learning notes-tree and two-fork tree

Source: Internet
Author: User

1, the formal definition of the tree:

A tree is a finite set of T, consisting of one or more nodes, which has a specific node called the root, and the remaining nodes can be divided into m (m≥0) disjoint finite set t1,t2,t3,..., Tm, each set is itself a tree, and is called the root subtree.

2, the basic terms of the tree:

1. Node: An element in a tree that contains data items and several branches that point to its subtree. 2. Node degree (degree): Number of subtrees owned by the node. 3. Hierarchy of nodes: Starting from the root node, the root is the first layer. 4. Leaf (leaf): A zero-degree node, also known as a junction point. 5. Child: The root of the knot point tree is called the node of the child node. 6. Parent: The upper node of the child's node, known as the parent of these nodes. 7. Brother (Sibling): Children of the same parents. 8. Depth (Depth): The maximum number of levels of nodes in a tree. 9. Forest (Forest): A collection of M-disjoint trees. 3, the storage structure of the tree 1. The storage structure of a tree can be a multi-linked list with multiple pointer fields, and the number of pointer fields in a node should be determined by the degree of the tree 2. In practice, however, this kind of storage structure is not convenient, and the tree is converted to two-tree representation and processed 3. You can use a tree to represent the definition of an arithmetic expression 4, binary tree (binary trees)

Binary tree is an important tree structure, its structure is defined as: Two is a finite set of nodes N (n≥0), it is either an empty tree (n=0), or a root node and two respectively called the root of the Saozi right sub-tree, disjoint two fork tree composition.

5, the nature of the binary tree

6, full two fork tree and complete binary tree 7, binary tree storage structure 8, the difference between the tree and the two fork Tree 9, the tree and the forest into two fork tree 10, the binary tree traversal 11, the establishment of a two-fork list, and the binary tree traversal

Basic Data Structure Learning notes-tree and 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.