-
```python
class Solution:
def minDepth(self, root: TreeNode) -> int:
if root is None:
return 0
depth = 1
q = []
q.append(root)
while l…
zyune updated
2 years ago
-
![image](https://user-images.githubusercontent.com/6414741/49027009-0fd58b00-f154-11e8-99f6-fed477ba7c1c.png)
-
Hello,
it seems that the procedure never enters in the "allowTraversal" function. Thus, it loops forever in case of graphs with cycles.
I don't know very well PowerShell, however from a first insi…
-
![bfs_search](https://user-images.githubusercontent.com/32113404/32105181-2e52b7c2-baed-11e7-848d-3c2bd2b689c5.gif)
-
-
-
# BFS
BFS(너비 우선 탐색)은 그래프를 탐색하는 방법 중 하나입니다.
정점들과 같은 레벨에 있는 노드(형제 노드)들을 먼저 탐색하는 방법으로 다음의 순서를 따릅니다.
1. 현재 정점과 인접한 간선들을 하나씩 검사합니다.
2. 현재 노드에서 방문할 수 있는 노드를 전부 방문합니다.
3. 전부 방문한 후 그 다음 레벨의 노드…
-
**This is a(n):**
- [ ] New algorithm
- [x] Update to an existing algorithm
- [ ] Error
- [ ] Proposal to the Repository
**Details:**
Add a description of the BFS algorithm and a…
-
The Swiss [Federal Statistical Office](https://www.bfs.admin.ch/bfs/en/home.html) publishes a key dataset showing linguistic statistics of the Swiss resident population on the [opendata.swiss](https:/…
loleg updated
5 years ago
-
Input:
* Connections among nodes
* A source node
* A destination node
Output:
* Printed path (like 'Messi' -> 'Di Maria' -> 'Ronaldo' -> 'Ramos' where source node is 'Messi' and destination nod…