![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树的直径
Somethingwll
先这样吧。。。
展开
-
图的邻接表存储用C实现
原文链接:http://blog.csdn.net/linxinyuluo/article/details/6847851 用到的数据结构是 一个是顶点表,包括顶点和指向下一个邻接点的指针 一个是边表, 数据结构跟顶点不同,存储的是顶点的序号,和指向下一个的指针 刚开始的时候把顶点表初始化,指针指向null。然后边表插入进来,是插入到前一个,也就是直接转载 2016-08-02 16:14:35 · 299 阅读 · 0 评论 -
lightoj-1094-Farthest Nodes in a Tree【树的直径模板】
1094 - Farthest Nodes in a Tree PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Given a tree (a connected graph with no cycles),原创 2016-08-02 15:04:00 · 290 阅读 · 0 评论 -
poj-1985-Cow Marathon【树的直径】
Cow Marathon Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 5018 Accepted: 2441 Case Time Limit: 1000MS Description After hearing about the epidemi原创 2016-08-02 17:46:44 · 273 阅读 · 0 评论 -
poj-2631-Road in the North【树的直径】
Roads in the North Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2612 Accepted: 1291 Description Building and maintaining roads among communities in th原创 2016-08-02 18:14:32 · 286 阅读 · 0 评论 -
poj-1383-Labyrinth【树的直径】【经典】
Labyrinth Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 4274 Accepted: 1608 Description The northern part of the Pyramid contains a very large and comp原创 2016-08-02 20:49:39 · 265 阅读 · 0 评论 -
建邻接表的两种方式
/* * 构建邻接表模板 * */ #include #include int head[100100];//表头,head[i]代表起点是i的边的编号 int cnt;//代表边的编号 struct s { int u;//记录边的起点 int v;//记录边的终点 int w;//记录边的权值原创 2016-08-18 10:51:08 · 447 阅读 · 0 评论