DSU 常指 Disjoint Set Union,即“不相交集合并”数据结构(也常叫 Union-Find / 并查集),用于维护若干集合的合并与查询元素所属集合(连通性)等操作。在不同语境中也可能表示其他缩写,但算法与竞赛编程里最常见的是此义。
/ˌdiː ɛs ˈjuː/
I used DSU to check whether two nodes are connected.
我用 DSU 来检查两个节点是否连通。
With path compression and union by rank, a DSU can handle millions of union and find operations efficiently in Kruskal’s algorithm.
配合路径压缩与按秩合并,DSU 能在 Kruskal 算法中高效处理数百万次合并与查找操作。
DSU 是 Disjoint Set Union 的首字母缩写:disjoint(互不重叠的)+ set(集合)+ union(合并)。在算法领域,它用来表示对“互不相交的集合”进行“合并(union)”与“查找(find)”的一类经典数据结构。