---
title: "Discussion on \"并查集（Disjoint Set Union, DSU）\" | Hashnode"
description: "Discussion on \"并查集（Disjoint Set Union, DSU）\". 并查集（Disjoint Set Union, DSU）是一种非常有用的数据结构，主要用来处理一些不相交集合的合并及查询问题。听起来很抽象，但其实核心就两个操作：\n\nfind：查找一个元素属于哪个集合（通常通过返回该集合的代表元素，也就是根节点）。\n\nunion：将两个元素所在的集合合并成一个集合。\n\n\n为了让find操作更快，我们通常会加上一个“路径压缩”的优化。为了让合并后的树结构更平衡，会加上“按秩合并”或“按大小合并”的优化。\n\n10.2 一维并查集的应用算法设计\n10.2.1 以图判树..."
url: "https://hashnode.com/posts/disjoint-set-union-dsu/68e11c96a2e2c1611415d1f4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [并查集（Disjoint Set Union, DSU）](https://xiaoh.hashnode.dev/disjoint-set-union-dsu?utm_source=hashnode&utm_medium=feed)

并查集（Disjoint Set Union, DSU）是一种非常有用的数据结构，主要用来处理一些不相交集合的合并及查询问题。听起来很抽象，但其实核心就两个操作： find：查找一个元素属于哪个集合（通常通过返回该集合的代表元素，也就是根节点）。 union：将两个元素所在的集合合并成一个集合。 为了让find操作更快，我们通常会加上一个“路径压缩”的优化。为了让合并后的树结构更平衡，会加上“按秩合并”或“按大小合并”的优化。 10.2 一维并查集的应用算法设计 10.2.1 以图判树...

Oct 4, 2025 · 12 min read · xiaoh.hashnode.dev  
Read the article

-   [#5bm25pl6zug](https://hashnode.com/tag/5bm25pl6zug)

## Written by

[MrHe](https://hashnode.com/@MrHe)

@MrHe

  
[View profile](https://hashnode.com/@MrHe)

河南科技大学-软件工程

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
