# Python dictionary to act as an adjacency list
graph = {
'7' : ['19','21', '14'],
'19': ['1', '12', '31'],
'21': [],
'14': ['23', '6'],
'1' : [],
'12': [],
'31': [],
'23': [],
'6' : []
}
visited = [] # List of visited nodes of graph.
def dfs(visited, graph, node):
if node not in visited:
visited.append(node)
for neighbor in graph[node]:
df