我们先看下面一段程序:publicclassSon:Father{publicvoidRun0(){Console.WriteLine("Son.Run0");}}classProgram{staticvoidMain(string[]args){Father[]fatherList=newFath...
分类:
Web程序 时间:
2014-08-15 09:23:47
阅读次数:
238
题意:给出n个村庄之间的距离,再给出已经连通起来了的村庄。求把所有的村庄都连通要修路的长度的最小值。思路:Kruskal算法课本代码://Kruskal算法#includeusing namespace std;int fa[120];int get_father(int x){ return fa...
分类:
其他好文 时间:
2014-08-13 14:21:16
阅读次数:
212
我觉得 这题 是纯粹的 并查集 可以算成 入门题吧问你有几章桌子 就是问你有几个 连通块嘛 一个道理 touch me这题 我采用了下 father[x]开始 初始化为-1 1 #include 2 #include 3 using namespace std; 4 5 const in...
分类:
其他好文 时间:
2014-08-13 00:50:14
阅读次数:
176
注意事项:阅读本文前应该先了解java的继承。本文定位为已经继承基础知识。一:试图覆盖私有方法先上代码 1 public class Father { 2 3 private void print() { 4 System.out.println("private prin...
分类:
编程语言 时间:
2014-08-10 21:15:50
阅读次数:
264
//1.联通图 2.顶点度数都为偶数 ,则存在欧拉回路。
# include
# include
# include
using namespace std;
int father[1010];
int vis[1010][1010],du[1010];
int find(int x)
{
if(father[x]==x)
return x;
return f...
分类:
其他好文 时间:
2014-08-10 10:25:30
阅读次数:
218
维基百科:http://zh.wikipedia.org/zh-cn/并查集假设初始化时用数组表示每个位置上的元素其father是自己,以对象是整数集为例Init:fori<- 1:n do father[i]<- i;findFather(x)if father[x] = x return f.....
分类:
其他好文 时间:
2014-08-08 15:45:36
阅读次数:
169
document.getElementById('eastFrame').setAttribute('src','#'); // this will copy father window to this iframe(function() { Grs = function() { ...
分类:
编程语言 时间:
2014-08-08 12:23:45
阅读次数:
170
最近温习《learn objective-c on the mac》第4章关于重写的调用了[super setFillColor:c]很不理解其作用,可能是因为翻译逻辑不清的原因吧,特地写了个小例子理解一下定义一个father类和son类father:#import @interface fathe...
分类:
其他好文 时间:
2014-08-06 11:41:41
阅读次数:
241