Skip to content

Commit 8ffa90d

Browse files
committed
Added some comments
1 parent 2b42b7c commit 8ffa90d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

C++/chapBFS.tex

+6
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,9 @@ \subsubsection{单队列}
338338
gen_path(father, start_state, state, path, result);
339339
continue;
340340
}
341+
// 必须挪到下面,比如同一层A和B两个节点均指向了目标节点,
342+
// 那么目标节点就会在q中出现两次,输出路径就会翻倍
343+
// visited.insert(state);
341344

342345
// 扩展节点
343346
const auto& new_states = state_extend(state);
@@ -1099,6 +1102,9 @@ \subsubsection{求所有路径}
10991102
gen_path(father, start_state, state, path, result);
11001103
continue;
11011104
}
1105+
// 必须挪到下面,比如同一层A和B两个节点均指向了目标节点,
1106+
// 那么目标节点就会在q中出现两次,输出路径就会翻倍
1107+
// visited.insert(state);
11021108

11031109
// 扩展节点
11041110
const auto& new_states = state_extend(state);

C++/leetcode-cpp.pdf

435 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)