摘要:
问题:给出一个n结点的图,求最大边与最小边差值最小的生成树 my code: #include #include #include #include #include #include using namespace std;
#define N 102
#define INF 0x7fffffff struct Edge { int u, v, w; bool op... 阅读全文
摘要:
问题:输入一个结点的无根树的各条边,并指定一个根结点,要求把该树转化为有根树 测试oj:nyoj http://acm.nyist.net/JudgeOnline/problem.php?pid=20 当结点数很多时若用邻接矩阵存储图将占用很大的空间,此时可使用vector或邻接表存储,由于vector内存的增长方式问题也可能会引起内存过大问题,此时邻接表存储更具优势 代码: 使用vector... 阅读全文
![](/skins/gray/images/separator.gif)