摘要: 转载:http://blog.sina.com.cn/s/blog_616694280100f06p.html图的两种存储方式:邻接矩阵和邻接表;两种遍历方式:深度优先和广度优先;首先以一个结构体存储一个图:struct MGraph{int vertex[maxvertex];//存顶点int arc[maxvertex][maxvertex];//存边(邻接矩阵)int vertexnum,arcnum;//顶点数和边数};其次是对图的初始化:void CreatMGraph(MGraph *&G){int i,j;cin1>>G->vertexnum>&g 阅读全文
posted @ 2011-07-27 15:28 AC_Von 阅读(5725) 评论(0) 推荐(0) 编辑