当前位置:网站首页>Properties of binary tree~
Properties of binary tree~
2022-07-26 05:45:00 【[email protected]】
- It's not the second of an empty binary tree i layer , At most 2 i-1 Nodes ( i ≥1 )
deduction : There is a node in the first layer of a full binary tree , The root node , The second layer has two nodes , The third layer has four nodes , There are eight nodes on the fourth floor …
And so on , The first i layer , At most 2 i-1 Nodes
- At a height of h There are at most 2 h -1 Nodes ( h ≥1 )
deduction : Summation formula of equal ratio sequence : First item x(1 - Gongbi n )/(1 - Gongbi )
And in the non empty binary tree , Gongbi = 2, First item = 1, and n Is the height of the binary tree ( Or depth )
so: Total number of nodes = 1 x(1 - 2 h )/(1 - 2), After simplification :2 h -1
- For any non empty binary tree , If the number of leaf nodes is n0 , Degree is 2 The number of nodes of is n2 , Then there are :n0 = n2 + 1
deduction : Suppose for a non empty binary tree , The number of leaf nodes is n0, Degree is 1 The number of nodes of is n1 , Degree is 2 The number of nodes of is n2, be
Sum up points = n0 + n1 + n2 , The total number of edges = n1 + 2n2
Each node corresponds to an edge , Except for the root node
so: Sum up points -1 = The total number of edges —> n0 + n1 + n2 -1 = n1 + 2n2 —> n0 = n2 + 1
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/207/202207260542336329.html
边栏推荐
- 5-year-old Test Engineer - how to choose the next step?
- Qt编写物联网管理平台47-通用数据库设置
- Jdbc流式查询与游标查询
- Is it really hopeless to choose electronic engineering and be discouraged?
- Attack and defense world flatscience
- Three implementation methods of thread and the usage of handler
- 87. Disturb string
- MongonDB API使用
- Application of canoe XML in test modules
- 高分子物理知识点
猜你喜欢

Redis事务

idea yml 文件代码不提示解决方案

The idea YML file code does not prompt the solution
![[STM32 series summary] blogger's way to quickly advance STM32 in actual combat (continuous update)](/img/20/bf7d2653aafd35e6588f819d110453.png)
[STM32 series summary] blogger's way to quickly advance STM32 in actual combat (continuous update)

OD-Paper【2】:Fast R-CNN

Benji Bananas 开启第二季边玩边赚奖励活动,支持使用多张 Benji 通行证!

MBA-day29 算术-绝对值初步认识

Day011 one dimensional array

Knowledge points of Polymer Physics

IVR在voip电话系统的应用与价值
随机推荐
sdc中对cdc的处理方式
【STM32系列汇总】博主的STM32实战快速进阶之路(持续更新)
Day110.尚医通:Gateway集成、医院排班管理:科室列表、根据日期统计数据、排班详情
Unity Profiler
ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirments.txt’
Redis主从复制
Redis transaction
[论文笔记] 面向网络语音隐写的抗分组丢失联合编码
金仓数据库 KingbaseES SQL 语言参考手册 (11. SQL语句:ABORT 到 ALTER INDEX)
Benji Banas launched the second season of earn while playing bonus activities, supporting the use of multiple Benji passes!
leetcode-aboutString
OD-Paper【1】:Rich feature hierarchies for accurate object detection and semantic segmentation
Two auxiliary functions of integral Mall for business user operation
Who is responsible for the problems of virtual idol endorsement products? And listen to the lawyer's analysis
金仓数据库 KingbaseES SQL 语言参考手册 (10. 查询和子查询)
Nn.moudle module - details of creating neural network structure
MongoDB 常用命令
Mba-day29 arithmetic - preliminary understanding of absolute value
MBA-day29 算术-绝对值初步认识
TZC 1283: simple sort - Comparative sort