After Width: | Height: | Size: 361 KiB |
After Width: | Height: | Size: 474 KiB |
After Width: | Height: | Size: 317 KiB |
After Width: | Height: | Size: 359 KiB |
After Width: | Height: | Size: 122 KiB |
After Width: | Height: | Size: 478 KiB |
After Width: | Height: | Size: 435 KiB |
After Width: | Height: | Size: 402 KiB |
After Width: | Height: | Size: 282 KiB |
After Width: | Height: | Size: 349 KiB |
After Width: | Height: | Size: 211 KiB |
After Width: | Height: | Size: 294 KiB |
After Width: | Height: | Size: 326 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 370 KiB |
After Width: | Height: | Size: 145 KiB |
@ -0,0 +1,2 @@
|
|||||||
|
### 一、基本概念
|
||||||
|
深度优先遍历类似于树的先根遍历
|
@ -0,0 +1,8 @@
|
|||||||
|
可以理解为使用二分查找寻找插入位置
|
||||||
|
![[微信截图_20221230143349.png]]
|
||||||
|
+ 折半查找比顺序查找快,所以折半插入排序平均性能比直接插入排序快
|
||||||
|
+ 折半插入排序所需要的关键码比较次数与待排序对象序列的初始排序无关,仅依赖于对象个数。在插入对象时,需要经过[log2i]+1 次关键码比较,才能确定它插入的位置;
|
||||||
|
+ 折半插入排序的对象移动次数与直接插入排序相同,依赖于对象的初始排列
|
||||||
|
|
||||||
|
时间复杂度O(n平方)
|
||||||
|
空间复杂度O(1)
|
@ -0,0 +1,4 @@
|
|||||||
|
采用顺序查找法查找插入位置
|
||||||
|
|
||||||
|
关键点:插入位置查找
|
||||||
|
|
@ -0,0 +1,2 @@
|
|||||||
|
### 定义
|
||||||
|
贪心算法或贪心思想采用贪心的策略,保证每次操作都是局部最优的,从而使最后得到的结果是全局最优。
|