当前位置:网站首页>Basic knowledge of binary tree

Basic knowledge of binary tree

2022-07-07 22:49:00 Qingshan's green shirt

Basic knowledge of binary tree

1. The species of binary trees

There are two main topics : Full binary tree and full binary tree .

(1) Full binary tree

 Insert picture description here

(2) Perfect binary tree

 Insert picture description here

(3) Binary search tree

 Insert picture description here

(4) Balanced binary search trees

 Insert picture description here

2. Binary tree storage

Chain store :

 Insert picture description here

Sequential storage :

 Insert picture description here

3. The traversal of binary tree

 Insert picture description here
 Insert picture description here
 Insert picture description here

4. The definition of binary tree ( Code )

struct TreeNode{
    
	int val;
	TreeNode* left;// Left child pointer 
	TreeNode* right;// Right child pointer 
	TreeNode(int x):val(x),left(NULL),right(NULL){
    }
	} 
};
原网站

版权声明
本文为[Qingshan's green shirt]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130603147595.html