Created
May 23, 2019 23:14
-
-
Save travisjungroth/0b7b52040397d49df69c3d129768d744 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from graphs import depth_first_connected_nodes_iterative | |
graph = { | |
'A': { | |
'B', | |
}, | |
'B': { | |
'C', | |
'D', | |
}, | |
'C': { | |
'E', | |
}, | |
'D': set(), | |
'E': set(), | |
'F': set(), | |
} | |
def test_depth_first_search(): | |
assert depth_first_connected_nodes_iterative(graph, 'A') == set('ABCDE') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment