Skip to content

Commit 3a264ff

Browse files
committed
auto commit
1 parent e9d55fe commit 3a264ff

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

notes/算法.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ public static Comparable select(Comparable[] a, int k) {
901901

902902
## 二分查找实现有序符号表
903903

904-
使用一对平行数组,一个存储键一个存储值。其中键的数组为 Comparable 数组,值的数组为 Object 数组。
904+
使用一对平行数组,一个存储键一个存储值。
905905

906906
rank() 方法至关重要,当键在表中时,它能够知道该键的位置;当键不在表中时,它也能知道在何处插入新键。
907907

@@ -976,7 +976,7 @@ public class BinarySearchST<Key extends Comparable<Key>, Value> {
976976

977977
BST 有一个重要性质,就是它的中序遍历结果递增排序。
978978

979-
<div align="center"> <img src="../pics//05e41947-3cbc-4f02-a428-96765ec916ff.png" width="200"/> </div><br>
979+
<div align="center"> <img src="../pics//fbe54203-c005-48f0-8883-b05e564a3173.png" width="200"/> </div><br>
980980

981981
基本数据结构:
982982

@@ -1017,8 +1017,6 @@ public class BST<Key extends Comparable<Key>, Value> {
10171017
- 如果被查找的键和根节点的键相等,查找命中;
10181018
- 否则递归地在子树中查找:如果被查找的键较小就在左子树中查找,较大就在右子树中查找。
10191019

1020-
BST 的查找操作每次递归都会让区间减少一半,和二分查找类似,因此查找的复杂度为 O(logN)。
1021-
10221020
```java
10231021
public Value get(Key key) {
10241022
return get(root, key);
@@ -1125,7 +1123,7 @@ private Node min(Node x) {
11251123

11261124
令指向最小节点的链接指向最小节点的右子树。
11271125

1128-
<div align="center"> <img src="../pics//26020e1a-06ab-4114-a6b3-e428de690c7e.png" width="500"/> </div><br>
1126+
<div align="center"> <img src="../pics//dd15a984-e977-4644-b127-708cddb8ca99.png" width="500"/> </div><br>
11291127

11301128
```java
11311129
public void deleteMin() {
@@ -1144,7 +1142,8 @@ public Node deleteMin(Node x) {
11441142
- 如果待删除的节点只有一个子树,那么只需要让指向待删除节点的链接指向唯一的子树即可;
11451143
- 否则,让右子树的最小节点替换该节点。
11461144

1147-
<div align="center"> <img src="../pics//3290673d-edab-4678-8b2e-f18e0f6b7fc1.png" width="400"/> </div><br>
1145+
<div align="center"> <img src="../pics//fa568fac-ac58-48dd-a9bb-23b3065bf2dc.png" width="400"/> </div><br>
1146+
11481147

11491148
```java
11501149
public void delete(Key key) {
11 KB
Loading
14 KB
Loading
8 KB
Loading

0 commit comments

Comments
 (0)