From 957adf455ae175fa5857e49d8f4ccbd4d16d00c8 Mon Sep 17 00:00:00 2001 From: Leon Xu Date: Mon, 4 Apr 2022 15:27:02 -0700 Subject: [PATCH] doc: create Disjoin Set section --- source/_posts/数据结构.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/_posts/数据结构.md b/source/_posts/数据结构.md index abc1c61..f55824b 100644 --- a/source/_posts/数据结构.md +++ b/source/_posts/数据结构.md @@ -202,4 +202,11 @@ HashMap的key是独一的的 set.add(1); set.add(2); set.contains(1); //return true -set.contains(3); //return false \ No newline at end of file +set.contains(3); //return false + +## Disjoint Set(Union Find) +并查集 是一种树形的数据结构,用于处理不交集的合并(union)及查询(find)问题。找几个数字是否在同一个group里面 +Find:确定元素属于哪一个子集。它可以被用来确定两个元素是否属于同一子集。 +Union:将两个子集合并成同一个集合。 + +![union-find](/image/union-find.png)