hdoj 5326 Work (简单并查集)

  It’s an interesting experience to move from ICPC to work, end my college life and start a brand new journey in company. As is known to all, every stuff in a company has a title, everyo...

好文章搜集

[转]图的理论基础

https://wangkuiwu.github.io/2013/04/05/graph-thesis/   图的基本概念 1. 图的定义 定义:图(graph)是由一些点(vertex)和这些点之间的连线(edge)所组成的;其中,点通常被成为"顶点(vertex)",而点与...

Prim算法

https://www.cnblogs.com/skywang12345/p/3711506.html 普里姆算法介绍 普里姆(Prim)算法,和克鲁斯卡尔算法一样,是用来求加权连通图的最小生成树的算法。 基本思想 对于图G而言,V是所有顶点的集合;现在...

Kruskal 最小生成树算法

一个非常好的GIF演示图 算法步骤说明   新建图G,G中拥有原图中相同的节点,但没有边 将原图中所有的边按权值从小到大排序 从权值最小的边开始,如果这条边连接的两个节点于图G中不...

Virtual Friends(并查集)

These days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends, their friends' fr...