Home>Article> There are several different forms of binary trees

There are several different forms of binary trees

藏色散人
藏色散人 Original
2020-07-02 09:23:35 15707browse

There are eight different forms of binary trees, which are: 1. Empty binary tree; 2. Binary tree with only root node; 3. Binary tree with only root node and left subtree TL; 4. Only root node and right subtree Binary tree of subtree TR; 5. Binary tree with root node, left subtree TL and right subtree TR; 6. Skewed binary tree; 7. Full binary tree; 8. Perfect binary tree.

There are several different forms of binary trees

Tree

Tree is a very important and widely used nonlinear data Structure

Binary tree

Five basic forms: empty binary tree, binary tree with only root node, binary tree with only root node and left subtree TL, only root node and right subtree Binary tree of subtree TR, binary tree with root node, left subtree TL and right subtree TR

Other binary trees: skew binary tree, full binary tree, perfect binary tree

Implementation method: sequential storage, Chain storage

Operation set: Create binary tree, determine whether it is empty, traverse (pre-order traversal, in-order traversal, post-order traversal, level order traversal)

The above is the detailed content of There are several different forms of binary trees. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn