当前位置:网站首页>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
边栏推荐
- YOLOV3预备工作
- Mba-day29 arithmetic - preliminary understanding of absolute value
- 高分子物理试题库
- Project topic selection reference
- Usage and common problems of SIP softphone registered with SIP account
- Lemon class automatic learning after all
- 金仓数据库 KingbaseES SQL 语言参考手册 (11. SQL语句:ABORT 到 ALTER INDEX)
- 调试利器!一款轻量级日志库 log.c
- Chapter 2 - getting started
- Hack the box - Web requests module detailed Chinese tutorial
猜你喜欢

Hack The Box - Introduction to Networking Module详细讲解中文教程

我又发现了超赞的软硬件项目,全部开源

如何从内存解析的角度理解“数组名实质是一个地址”?

Why can't lpddr completely replace DDR?

The idea YML file code does not prompt the solution

Embedded general learning route arrangement

FPGA question brushing sequence detection

Debugging sharp weapon! A lightweight log library log.c

LNMP architecture
![ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirments.txt’](/img/15/25ff1e544565e18319ecca85e614a2.png)
ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirments.txt’
随机推荐
Benji Bananas 开启第二季边玩边赚奖励活动,支持使用多张 Benji 通行证!
Benji Banas launched the second season of earn while playing bonus activities, supporting the use of multiple Benji passes!
为什么LPDDR不能完全代替DDR?
[MySQL must know and know] time function number function string function condition judgment
Yuancosmos provides a digital social platform for fashion design display
No EGL Display 报错解决
517. Super washing machine
vagrant下载速度慢的解决方法
Another open source artifact, worth collecting and learning!
The refurbishment and counterfeiting of chips have made people feel numb
Attack and defense world flatscience
Introduction to Chinese text error correction task
高频电子线路复习考试题及答案
项目版本号怎么命名?看起来牛B
Day110.尚医通:Gateway集成、医院排班管理:科室列表、根据日期统计数据、排班详情
C language explanation series -- understanding of functions (3) formal parameters, arguments, nested calls and chain access
ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirments.txt’
leetcode-aboutString
How to understand "array name is essentially an address" from the perspective of memory parsing?
Use of feign (Part 2)