当前位置:网站首页>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
边栏推荐
- (core focus of software engineering review) Chapter V detailed design exercises
- 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
- level16
- idea问题记录
- Unity3d, Alibaba cloud server, platform configuration
- Solution to the problem of automatic login in Yanshan University Campus Network
- Pat 1097 duplication on a linked list (25 points)
- Conditional probability
- Teach you to release a DeNO module hand in hand
- PR 2021 quick start tutorial, first understanding the Premiere Pro working interface
猜你喜欢
Design and implementation of general interface open platform - (39) simple and crude implementation of API services
There is no red exclamation mark after SVN update
Mysql database index
js 变量作用域和函数的学习笔记
NRF24L01 troubleshooting
Unity3D,阿里云服务器,平台配置
Basic operations of databases and tables ----- classification of data
NRF24L01故障排查
[Red Treasure Book Notes simplified version] Chapter 12 BOM
(五)R语言入门生物信息学——ORF和序列分析
随机推荐
JS variable types and common type conversions
[899]有序队列
Compilation principle: preprocessing of source program and design and implementation of lexical analysis program (including code)
Single chip Bluetooth wireless burning
idea中导包方法
Stm32f1+bc20+mqtt+freertos system is connected to Alibaba cloud to transmit temperature and humidity and control LED lights
Important methods of array and string
SSD technical features
(core focus of software engineering review) Chapter V detailed design exercises
Idea problem record
CUDA C programming authoritative guide Grossman Chapter 4 global memory
Detailed explanation of truncate usage
js题目:输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。
1081 rational sum (20 points) points add up to total points
[offer29] sorted circular linked list
[golang] leetcode intermediate - fill in the next right node pointer of each node & the k-smallest element in the binary search tree
Office提示您的许可证不是正版弹框解决
(课设第一套)1-4 消息传递接口 (100 分)(模拟:线程)
Fabrication of fairygui simple Backpack
Mysql database reports an error: row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT=DY