Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9b65c86

Browse files
committed
修正内容
1 parent 3737be2 commit 9b65c86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎docs/solutions/0700-0799/swim-in-rising-water.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- $n == grid.length$。
2222
- $n == grid[i].length$。
2323
- 1ドル \le n \le 50$。
24-
- 0ドル \le grid[i][j] < n2$。
24+
- 0ドル \le grid[i][j] < n^2$。
2525
- $grid[i][j]$ 中每个值均无重复。
2626

2727
**示例**:
@@ -124,6 +124,6 @@ class Solution:
124124

125125
### 思路 1:复杂度分析
126126

127-
- **时间复杂度**:$O(m \times n \times \alpha(m \times n)),ドル其中 $\alpha$ 是反 Ackerman 函数。
128-
- **空间复杂度**:$O(m \times n)$
127+
- **时间复杂度**:$O(n^2 \log n)$。其中 $n$ 为网格的边长,$n^2$ 为总格子数。枚举所有相邻格子的边,边数为 $O(n^2),ドル排序所有边的时间复杂度为 $O(n^2 \log n^2) = O(n^2 \log n)$。并查集的合并与查找操作均摊 $O(\alpha(n^2)),ドル$\alpha$ 为反 Ackermann 函数,极慢增长,可视为常数。因此整体复杂度为 $O(n^2 \log n)$
128+
- **空间复杂度**:$O(n^2)$。主要用于存储并查集的父节点数组和所有边的信息,均为 $O(n^2)$ 级别
129129

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /