码迷,mamicode.com
首页 > 其他好文 > 详细

邻接表+链式前向星

时间:2019-04-28 20:28:44      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:tle   http   邻接表   text   ext   [1]   .net   size   描述   

(我一个蒟蒻.分不清这两个姐妹qwq

技术图片

邻接表:

1 -> 2 -> 3 -> 5
2 -> 3
3 -> 4
4 -> 1 -> 5
5 ->^

 

链式前向星:

edge[0].to = 2;     edge[0].next = -1;     head[1] = 0;

edge[1].to = 3;     edge[1].next = -1;     head[2] = 1;

edge[2].to = 4;     edge[2],next = -1;     head[3] = 2;

edge[3].to = 3;     edge[3].next = 0;      head[1] = 3;

edge[4].to = 1;     edge[4].next = -1;      head[4] = 4;

edge[5].to = 5;    edge[5].next = 3;       head[1] = 5;

edge[6].to = 5;     edge[6].next = 4;       head[4] = 6;

 

盗图怪是我了

邻接表+链式前向星

标签:tle   http   邻接表   text   ext   [1]   .net   size   描述   

原文地址:https://www.cnblogs.com/darlingroot/p/10786210.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!