Skip to content

Commit 55f43a0

Browse files
authored
Merge pull request #501 from taojin1992/patch-2
2 parents 1de30e2 + 5a56fa1 commit 55f43a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

problems/785.is-graph-bipartite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Solution:
109109
令 v 和 e 为图中的顶点数和边数。
110110

111111
- 时间复杂度:$O(v+e)$
112-
- 空间复杂度:$O(v+e)$
112+
- 空间复杂度:$O(v)$, stack depth = $O(v)$, and colors array.length = $O(v)$
113113

114114

115115
如上代码并不优雅,之所以这么写只是为了体现和 886 题一致性。一个更加优雅的方式是不建立 grid,而是利用题目给的 graph(邻接矩阵)。

0 commit comments

Comments
 (0)