首页 > 其他 > 详细

邻接表+链式前向星

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

(我一个蒟蒻.分不清这两个姐妹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;

 

盗图怪是我了

邻接表+链式前向星

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!