当前位置:网站首页>二叉树的性质 ~
二叉树的性质 ~
2022-07-26 05:43:00 【柯基@】
- 非空二叉树的第 i 层,最多有2 i-1 个结点( i ≥1 )
推导:满二叉树中第一层有一个结点,即根结点,第二层有两个结点,第三层有四个结点,第四层有八个结点 …
以此类推,第 i 层,最多有2 i-1 个结点
- 在高度为 h 的二叉树上最多有2 h -1个结点 ( h ≥1 )
推导:等比数列求和公式:首项 x(1 - 公比 n )/(1 - 公比)
而在非空二叉树当中,公比 = 2,首项 = 1,而 n 则为二叉树的高度(或深度)
so:结点总数 = 1 x(1 - 2 h )/(1 - 2),化简后得:2 h -1
- 对于任何一棵非空二叉树,如果叶子结点的个数为 n0 ,度为 2 的结点个数为 n2 ,则有:n0 = n2 + 1
推导:假设对于一棵非空二叉树,叶子结点的个数为 n0,度为 1 的结点的个数为 n1 ,度为 2 的结点的个数为 n2,则
总结点数= n0 + n1 + n2 ,总边数= n1 + 2n2
而每个结点上都对应一条边,除了根节点
so:总结点数 -1 = 总边数 —> n0 + n1 + n2 -1 = n1 + 2n2 —> n0 = n2 + 1
边栏推荐
猜你喜欢
随机推荐
How can red star Macalline design cloud upgrade the traditional home furnishing industry in ten minutes to produce film and television level interior design effects
又一开源神器,值得收藏学习!
Mba-day29 arithmetic - preliminary understanding of absolute value
IVR在voip电话系统的应用与价值
DOM操作--操作节点
项目版本号怎么命名?看起来牛B
柠檬班自动化学习毕竟
中文文本纠错任务简介
QT writing IOT management platform 47 general database settings
No EGL Display 报错解决
LNMP架构
NFT in the eyes of blackash: the platform is crying for slaughter, and users send money to the door
Rocbossphp free open source light community system
Benji Banas launched the second season of earn while playing bonus activities, supporting the use of multiple Benji passes!
秋招-准备计划
Who is responsible for the problems of virtual idol endorsement products? And listen to the lawyer's analysis
leetcode-Array
How to view the container name in pod
No EGL display error resolution
Application and value of IVR in VoIP telephone system




![[paper notes] anti packet loss joint coding for network speech steganography](/img/ca/95476b6d4b5765f5fde82cbeda577e.png)



