当前位置:网站首页>Prove the time complexity of heap sorting
Prove the time complexity of heap sorting
2022-07-06 12:43:00 【Lemon leaf C】
Time complexity of reactor building
Because the heap is a complete binary tree , A full binary tree is also a complete binary tree . To simplify , Full binary tree will be used to prove .( Time complexity is an approximation , So more nodes will not affect the final result ):
Suppose the height of the tree is :
The first
layer :
Nodes , Need to move down
layer
The first
layer :
Nodes , Need to move down
layer
The first
layer :
Nodes , Need to move down
layer
The first
layer :
Nodes , Need to move down
layer
……
The first
layer :
Nodes , Need to move down
layer
The total number of moving steps of the mobile node is :
①
②
② - ① Dislocation subtraction :
therefore , The time complexity of reactor construction is
边栏推荐
- Minio文件下载问题——inputstream:closed
- Conditional probability
- FairyGUI增益BUFF数值改变的显示
- Database course design: college educational administration management system (including code)
- FairyGUI人物状态弹窗
- 1041 Be Unique (20 point(s))(哈希:找第一个出现一次的数)
- (五)R语言入门生物信息学——ORF和序列分析
- Redis cache update strategy, cache penetration, avalanche, breakdown problems
- 如何给Arduino项目添加音乐播放功能
- By v$rman_ backup_ job_ Oracle "bug" caused by details
猜你喜欢
[Red Treasure Book Notes simplified version] Chapter 12 BOM
Stm32f1+bc20+mqtt+freertos system is connected to Alibaba cloud to transmit temperature and humidity and control LED lights
Theoretical derivation of support vector machine
JS variable types and common type conversions
Derivation of logistic regression theory
Teach you to release a DeNO module hand in hand
Particle system for introduction to unity3d Foundation (attribute introduction + case production of flame particle system)
idea中好用的快捷键
Unity3D基础入门之粒子系统(属性介绍+火焰粒子系统案例制作)
單片機藍牙無線燒錄
随机推荐
NRF24L01 troubleshooting
FairyGUI簡單背包的制作
Whistle+switchyomega configure web proxy
Types de variables JS et transformations de type communes
Acwing-116 pilot brother
Naive Bayesian theory derivation
Idea problem record
The master of double non planning left the real estate company and became a programmer with an annual salary of 25W. There are too many life choices at the age of 25
Pat 1097 duplication on a linked list (25 points)
Solution to the problem of automatic login in Yanshan University Campus Network
[Offer29] 排序的循环链表
Esp8266 connect onenet (old mqtt mode)
Introduction to the daily practice column of the Blue Bridge Cup
Intermediate use tutorial of postman [environment variables, test scripts, assertions, interface documents, etc.]
Who says that PT online schema change does not lock the table, or deadlock
Particle system for introduction to unity3d Foundation (attribute introduction + case production of flame particle system)
FairyGUI按钮动效的混用
Unity3D,阿里云服务器,平台配置
关于Gateway中使用@Controller的问题
单片机蓝牙无线烧录