Skip to content

Commit e8dafec

Browse files
authored
Apply suggestions from code review
1 parent 54e473d commit e8dafec

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

graphs/check_cycle.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ def check_cycle(graph: dict) -> bool:
77
"""
88
Returns True if graph is cyclic else False
99
10-
>>> graph1 = {0:[], 1:[0, 3], 2:[0, 4], 3:[5], 4:[5], 5:[]}
11-
>>> check_cycle(graph1)
10+
>>> check_cycle(graph={0:[], 1:[0, 3], 2:[0, 4], 3:[5], 4:[5], 5:[]})
1211
False
13-
>>> graph2 = {0:[1, 2], 1:[2], 2:[0, 3], 3:[3]}
14-
>>> check_cycle(graph2)
12+
>>> check_cycle(graph={0:[1, 2], 1:[2], 2:[0, 3], 3:[3]})
1513
True
1614
"""
1715
# Keep track of visited nodes

0 commit comments

Comments
 (0)