关于生成树协议的知识可参考我的另一个博客:https://www.cnblogs.com/mrlayfolk/p/12242627.html 这篇博文主要介绍快速生成树协议(RSTP)的基本知识。--参考书籍《网络之路--交换专题》 1、基本知识 RSTP是STP的改进,为了满足如今低时延高可靠性的 ...
分类:
其他好文 时间:
2020-01-30 23:12:13
阅读次数:
101
1、基本知识--摘至《网络之路--交换专题》 (1)生成树的作用:在链路层消除环路上可能出现的广播风暴。 (2)生成树的工作由三部分组成:选举过程、拓扑计算、端口行为确定。 选举过程:在二层网络中选举一个网桥作为根桥,用于指挥整网设备协同工作。根桥只是负责统一计算的规则。 根桥统一网络中所有网桥的行 ...
分类:
其他好文 时间:
2020-01-30 14:31:27
阅读次数:
339
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; const int N=510,M=10010; int ...
分类:
其他好文 时间:
2020-01-29 16:24:35
阅读次数:
79
#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=110; int p[N]; struct edge{ int a; int b; int w; }e[N*N]; in ...
分类:
其他好文 时间:
2020-01-29 14:22:30
阅读次数:
62
#include<iostream> #include<cmath> #include<algorithm> #include<cstdio> using namespace std; const int N=1e5; struct edge{ int a,b; double w; }e[N]; d ...
分类:
其他好文 时间:
2020-01-29 14:01:16
阅读次数:
89
#include<iostream> #include<algorithm> using namespace std; const int N=1e5; struct edge{ int a,b,w; }e[N]; bool cmp(edge a,edge b) { return a.w<b.w; ...
分类:
Web程序 时间:
2020-01-29 12:50:21
阅读次数:
89
求最小生成树常用,因为效率高(Omlgm) 给定一个n个点m条边的无向图,图中可能存在重边和自环,边权可能为负数。 求最小生成树的树边权重之和,如果最小生成树不存在则输出impossible。 给定一张边带权的无向图G=(V, E),其中V表示图中点的集合,E表示图中边的集合,n=|V|,m=|E| ...
分类:
编程语言 时间:
2020-01-28 15:46:00
阅读次数:
65
形似dijsktra算法, 但是不同于dijsktra算法,prim算法是找到当前集合最近的点, 而dij算法是找距离当前起点最近的点 给定一个n个点m条边的无向图,图中可能存在重边和自环,边权可能为负数。 求最小生成树的树边权重之和,如果最小生成树不存在则输出impossible。 给定一张边带权 ...
分类:
编程语言 时间:
2020-01-28 14:10:48
阅读次数:
80
类似于1213取水 可以把空投当作第0个城市 最后将0~n的所有城市跑最小生成树 1 /* 2 Written By StelaYuri 3 */ 4 #include<iostream> 5 #include<algorithm> 6 using namespace std; 7 struct r ...
分类:
其他好文 时间:
2020-01-27 09:43:38
阅读次数:
80
普普通通的最小生成树,写了一遍prim的,所以用一下克鲁斯卡尔 注意输入数据有多组 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> using names ...
分类:
Web程序 时间:
2020-01-26 22:15:08
阅读次数:
97