博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 - 

摘要:View Code 1 //----------------------图的广度优先搜索----------------------- 2 #include<stdio.h> 3 #include<stdlib.h> 4 5 #define MAXQUEUE 10 //队列的最大容量 6 7 8 struct node //图顶点结构声明 9 { 10 int vertex; //顶... 阅读全文

posted @ 2012-10-20 10:41 皇星客栈--Linux 阅读(192) 评论(0) 推荐(0)

摘要:这个写法我认为精简View Code 1 #include<stdio.h> 2 #include<malloc.h> 3 #include<stdlib.h> 4 5 typedef struct node 6 { 7 int vertex; 8 struct node *nextnode; 9 }*graph,Linknode;10 11 struct node head[9];12 int visited[9];13 14 void creategraph( int *node,int num )15 {16 graph newnode;17 grap 阅读全文

posted @ 2012-10-19 17:30 皇星客栈--Linux 阅读(195) 评论(0) 推荐(0)