From 62d974749581be00f0555390f78dce7551b5d5ff Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Wed, 11 Apr 2018 09:55:21 +0300 Subject: [PATCH] Add DFS. --- src/algorithms/graph/depth-first-search/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/algorithms/graph/depth-first-search/README.md b/src/algorithms/graph/depth-first-search/README.md index 84eb9c7b..8ec1a409 100644 --- a/src/algorithms/graph/depth-first-search/README.md +++ b/src/algorithms/graph/depth-first-search/README.md @@ -5,3 +5,12 @@ 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. + +## Complexity + +* Time: O(|V| + |E|) +* Space: O(|V|) + +## References + +[Wikipedia](https://en.wikipedia.org/wiki/Depth-first_search)