Add BFS and DFS for tree.

This commit is contained in:
Oleksii Trekhleb 2018-04-25 17:41:21 +03:00
parent 85585769ea
commit fd898812f3
4 changed files with 12 additions and 4 deletions

View File

@ -10,4 +10,6 @@ nodes first, before moving to the next level neighbors.
## References
[Wikipedia](https://en.wikipedia.org/wiki/Breadth-first_search)
- [Wikipedia](https://en.wikipedia.org/wiki/Breadth-first_search)
- [Tree Traversals (Inorder, Preorder and Postorder)](https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/)
- [BFS vs DFS](https://www.geeksforgeeks.org/bfs-vs-dfs-binary-tree/)

View File

@ -10,4 +10,6 @@ along each branch before backtracking.
## References
[Wikipedia](https://en.wikipedia.org/wiki/Depth-first_search)
- [Wikipedia](https://en.wikipedia.org/wiki/Depth-first_search)
- [Tree Traversals (Inorder, Preorder and Postorder)](https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/)
- [BFS vs DFS](https://www.geeksforgeeks.org/bfs-vs-dfs-binary-tree/)

View File

@ -10,4 +10,6 @@ nodes first, before moving to the next level neighbors.
## References
[Wikipedia](https://en.wikipedia.org/wiki/Breadth-first_search)
- [Wikipedia](https://en.wikipedia.org/wiki/Breadth-first_search)
- [Tree Traversals (Inorder, Preorder and Postorder)](https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/)
- [BFS vs DFS](https://www.geeksforgeeks.org/bfs-vs-dfs-binary-tree/)

View File

@ -10,4 +10,6 @@ along each branch before backtracking.
## References
[Wikipedia](https://en.wikipedia.org/wiki/Depth-first_search)
- [Wikipedia](https://en.wikipedia.org/wiki/Depth-first_search)
- [Tree Traversals (Inorder, Preorder and Postorder)](https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/)
- [BFS vs DFS](https://www.geeksforgeeks.org/bfs-vs-dfs-binary-tree/)