2013年11月20日

基于邻接表的广度优先搜索

摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 int vis[101]; 9 int n,m,k; 10 queueq; 11 12 struct node 13 { 14 int u,v; 15 struct node *next; 16 ... 阅读全文

posted @ 2013-11-20 09:16 随风浪子的博客 阅读(215) 评论(0) 推荐(0) 编辑

基于邻接矩阵的广度优先搜索遍历

摘要: 1 # include <stdio.h> 2 # include <string.h> 3 int map[100][100],vist[100]; 4 int q[100]; //优先队列存储临时值。 5 int n,m,t,flag; 6 void BFS(int t) 7 { 8 int f 阅读全文

posted @ 2013-11-20 08:27 随风浪子的博客 阅读(192) 评论(0) 推荐(0) 编辑

导航