摘要: Python实现图遍历 #coding=utf-8 def dfs(G,s): Q=[] S=set() Q.append(s) while Q: u=Q.pop() if u in S: continue S.add(u) Q.extend(G[u]) yield u def createGrap 阅读全文
posted @ 2022-03-25 14:50 Blue眼泪2016 阅读(203) 评论(0) 推荐(0) 编辑