摘要: This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was captured by a group of d 阅读全文
posted @ 2018-04-28 23:54 习惯就好233 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 给定一个有N个顶点和E条边的无向图,请用DFS和BFS分别列出其所有的连通集。假设顶点从0到N−1编号。进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点。 输入格式: 输入第1行给出2个整数N(0<N≤10)和E,分别是图的顶点数和边数。随后E行,每行给出一条边的两个端点。每 阅读全文
posted @ 2018-04-28 14:15 习惯就好233 阅读(384) 评论(0) 推荐(0) 编辑