摘要: 对象:有向图(有无权无所谓) 存储方式:邻接表(最好写罢了,空间也比较少) 核心代码: void topsort(adjgraph g) { int i,j; int visited[maxn]={0}; int st[maxn],top=-1; arcnode *p; for(int i=0;i< 阅读全文
posted @ 2018-11-21 19:24 shenyuli 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 适应对象:有权图(有向或无向都行) 图存储方式:邻接矩阵(有0和INF的那种,否则就over) 一、Floyd算法: 1。核心代码: void floyd() { int i,j,k; for(i=0;i<g.n;i++) for(j=0;j<g.n;j++) { dist[i][j]=g.edge 阅读全文
posted @ 2018-11-21 16:58 shenyuli 阅读(241) 评论(0) 推荐(0) 编辑
Live2D