mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-12-08 19:06:00 +00:00
17 lines
759 B
Markdown
17 lines
759 B
Markdown
# Depth-First Search (DFS)
|
|
|
|
Depth-first search (DFS) is an algorithm for traversing or
|
|
searching tree or graph data structures. One starts at
|
|
the root (selecting some arbitrary node as the root in
|
|
the case of a graph) and explores as far as possible
|
|
along each branch before backtracking.
|
|
|
|

|
|
|
|
## References
|
|
|
|
- [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/)
|
|
- [DFS Visualization](https://www.cs.usfca.edu/~galles/visualization/DFS.html)
|