-
# dfs 深度優先;遞歸 O(3n) -> O(n)
Preorder Traversal
/*內存使用較少,空間使用較少*/
# template
1. base case
# 以下順序可以交換
- do something
- recurse for subproblems
要相信自己的 recurse
pre(先打印在遞歸)/in(…
-
-
Given number of nodes and set of edges connecting some vertices of an undirected graph, compute and output the bfs traversal of that graph.
-
Hi, I have a question about your paper. I read your paper that you used the BFS algorithm to compare with some other framework. But it seems like the author of GraphChi didn't provide BFS in his sourc…
-
994. Rotting Oranges
```
func OrangesRotting(grids [][]int) (elapse int) {
const (
Empty = 0
Fresh = 1
Rotten = 2
)
rowNum := len(grids)
if rowNum == 0 {return}
colNum := len(g…
-
```javascript
const node = {
value: "A",
children: [
{
value: "B",
children: [{ value: "B1" }, { value: "B2" }]
},
{
value:…
-
I ran LonestarGPU's implementation of BFS on Hollywood input data set (https://suitesparse-collection-website.herokuapp.com/MM/LAW/hollywood-2009.tar.gz).
The application seems to hang.
I added prin…
-
## 문제
1. boj10026 - 적록색약 [링크](https://www.acmicpc.net/problem/10026)
2. boj2206 - 벽 부수고 이동하기 [링크](https://www.acmicpc.net/problem/2206)
3. boj2644 - 촌수 계산 [링크](https://www.acmicpc.net/problem/264…
-
최소거리 구하는 문제
-
Trying to pass `-posix-runtime -search=bfs -max-depth=10` as options results in:
```
Error running /home/klee/klee_build/bin/klee -posix-runtime -search=bfs -max-depth=10 /tmp/code/code.o:
klee: …