Skip to content

Commit a4c9506

Browse files
committed
重构“细节实现题”这章
1 parent 383d815 commit a4c9506

File tree

4 files changed

+156
-87
lines changed

4 files changed

+156
-87
lines changed

C++/LeetCodet题解(C++版).pdf

1.87 KB
Binary file not shown.

C++/chapBFS.tex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,10 @@ \subsubsection{代码}
151151
unordered_map<string, vector<string> > father; // 树
152152
unordered_set<string> current, next; // 当前层,下一层,用集合是为了去重
153153

154-
int level = 0; // 层数
155154
bool found = false;
156155

157156
current.insert(start);
158157
while (!current.empty() && !found) {
159-
++level;
160158
// 先将本层全部置为已访问,防止同层之间互相指向
161159
for (auto word : current)
162160
visited.insert(word);

C++/chapGraph.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ \subsubsection{分析}
4747
广度优先遍历或深度优先遍历都可以。
4848

4949

50-
\subsubsection{深搜}
50+
\subsubsection{DFS}
5151
\begin{Code}
5252
// LeetCode, Clone Graph
5353
// DFS,时间复杂度O(n),空间复杂度O(n)
@@ -79,7 +79,7 @@ \subsubsection{深搜}
7979
\end{Code}
8080

8181

82-
\subsubsection{广搜}
82+
\subsubsection{BFS}
8383
\begin{Code}
8484
// LeetCode, Clone Graph
8585
// BFS,时间复杂度O(n),空间复杂度O(n)

0 commit comments

Comments
 (0)