qingcheng奕  

2013年6月2日

摘要: //图 存顶点 存边 存顶点数 存边数//用临接表存储#include <iostream>typedef struct bian{ int j; struct bian* next;};//每一个点存储自己的边表,每个点最多10条边typedef struct dian{ char a; bian* bianbiao ;};//图存储边数,点数,以及点的集合,最多20个点typedef struct graph{ int n,e; struct dian dianbiao[20];};struct graph mygraph;int visited[20]... 阅读全文
posted @ 2013-06-02 11:09 qingcheng奕 阅读(242) 评论(1) 推荐(0) 编辑
 
摘要: 1 广搜存在问题!!!!! 2 //建立一棵树,然后做深搜,广搜 3 #include <iostream> 4 5 typedef struct node{ 6 int data; 7 struct node* left; 8 struct node* right; 9 }; 10 11 struct node* new_node(int _data) 12 { 13 node* temp = (node*)malloc(sizeof(node)); 14 if(!temp) 15 { 16 printf... 阅读全文
posted @ 2013-06-02 11:08 qingcheng奕 阅读(226) 评论(0) 推荐(0) 编辑