13-1
def search_graph(g,start): check=set() add=[] check.add(start) add.append(start) while add: p=add.pop(0) print(p) for x in g[p]: if x not in check: check.add(x) add.append(x) graph={ 1:[2,3], 2:[4,5], 3:[1], 4:[2], 5:[2] } search_graph(graph,1)