Skip to content

Commit c8a992a

Browse files
committed
Updated depth first search
1 parent 924fcf2 commit c8a992a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pygorithm/searching/depth_first_search.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ def dfs(graph, start, path = []):
1515
# time complexities
1616
def time_complexities():
1717
return '''O(V + E) where V = Number of vertices and E = Number of Edges'''
18+
19+
# easily retrieve the source code of the dfs function
20+
def get_code():
21+
import inspect
22+
return inspect.getsource(dfs)

0 commit comments

Comments
 (0)