Data Structure: Binary and other trees (data structure, Algorithm and Application (C ++ language description) Chapter 8th)

Source: Internet
Author: User

8.1 Trees

--> Basic concepts of root, children, parent, siblings, leaf; level and degree of element


8.2 Binary Trees

--> What kind of tree is Binary Tree?


8.3. Properties of Binary Tree

--> Relationship between the number of nodes and height of the tree

--> Full binary tree to complete binary tree

--> Relationship between parent and child sequence numbers in the complete binary tree: it is also the basis for implementing binary tree using the formula-based method.


8.4. Representation of Binary Trees

--> Formula-based representation: array

: Only efficient when the number of missing elements is small.

--> Linked Representation

: PreOrder, InOrder, PostOrder Traversal (recursive) use stack

: LevelOrder Traversal (not recursive) use queue

: Leads to an important logic. If each step of an algorithm can be implemented in a stack mode, the algorithm may be implemented using a recursive method.

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.