2011年2月23日

CLRS: union_find_sets

摘要: //union_find_sets#include <assert.h>#include <stdio.h>#include <stdlib.h>#include <memory.h>//两个优化://1:rank数组的引入,启发式函数//2:路径压缩;//Abstract: UFSet //Author:Lifeng Wang (Fandywang)// Model One 与Model 2 路径压缩方式不同,合并标准不同const int MAXSIZE = 500010;int rank[MAXSIZE]; // 节点高度的上界int pa 阅读全文

posted @ 2011-02-23 20:27 cutepig 阅读(297) 评论(0) 推荐(0) 编辑

导航