Skip to content

Commit d8458d8

Browse files
committed
修改图片目录
1 parent 4e0d64e commit d8458d8

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎notes/数据结构与算法.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public static void swap(int[] arr,int i,int j) {
341341

342342
若果数组中含有大量重复的元素,则partition很可能把数组划分成两个及其不平衡的两部分,时间复杂度退化成O(n²)。这时候应该把小于v和大于v放在数组两端。
343343

344-
![](pics\partition2.jpg)
344+
![](pics/partition2.jpg)
345345

346346
```java
347347
// 双路快速排序的partition
@@ -397,7 +397,7 @@ private static void QuickSort2Ways(int[] arr, int l, int r) {
397397

398398
在具有大量重复键值对的情况下使用三路快排
399399

400-
![](pics\partition3.jpg)
400+
![](pics/partition3.jpg)
401401

402402

403403

@@ -444,13 +444,13 @@ private static void QuickSort3Ways(int[] arr, int l, int r){
444444

445445
堆可以用数组来表示,因为堆是完全二叉树,而完全二叉树很容易就存储在数组中。位置 k 的节点的父节点位置为 k/2,而它的两个子节点的位置分别为 2k 和 2k+1。这里不使用数组索引为 0 的位置,是为了更清晰地描述节点的位置关系。
446446

447-
![](pics\heap.png)
447+
![](pics/heap.png)
448448

449449
##### 2.上浮和下沉
450450

451451
在堆中,当一个节点比父节点大,那么需要交换这个两个节点。交换后还可能比它新的父节点大,因此需要不断地进行比较和交换操作,把这种操作称为**上浮(ShiftUp)**。
452452

453-
![](pics\shiftup_heap.png)
453+
![](pics/shiftup_heap.png)
454454

455455
```java
456456
private void shiftUp(int k){
@@ -465,7 +465,7 @@ private void shiftUp(int k){
465465

466466
类似地,当一个节点比子节点来得小,也需要不断地向下进行比较和交换操作,把这种操作称为**下沉(Shift Down)**。一个节点如果有两个子节点,应当与两个子节点中最大那么节点进行交换。
467467

468-
![](pics\shiftdown_heap.png)
468+
![](pics/shiftdown_heap.png)
469469

470470
```java
471471
private void shiftDown(int k){
@@ -636,7 +636,7 @@ bool operator<(const Student& otherStudent){
636636

637637

638638

639-
![](pics\sort_algorithm_analyze.png)
639+
![](pics/sort_algorithm_analyze.png)
640640

641641

642642

0 commit comments

Comments
 (0)