This repository has been archived on 2022-06-22. You can view files and clone it, but cannot push or open issues or pull requests.
usaco-guide/content/5_Gold/DSU.md

32 lines
1.4 KiB
Markdown
Raw Normal View History

2020-06-22 01:45:24 +00:00
---
id: dsu
title: "Disjoint Set Union"
author: Benjamin Qi, Michael Cao
2020-06-22 14:26:06 +00:00
prerequisites:
2020-06-22 20:51:12 +00:00
- Silver - Depth First Search
2020-06-22 19:59:16 +00:00
description: The Disjoint Set Union (DSU) data structure allows you to add edges to an initially empty graph and test whether two vertices of the graph are connected.
2020-06-22 01:45:24 +00:00
---
## Tutorial
2020-06-23 01:00:35 +00:00
- CPH 15.2
- [PAPS 11.1](https://www.csc.kth.se/~jsannemo/slask/main.pdf)
- Chapter 10.6 of "An Introduction to the US Computing Olympiad"
2020-06-22 01:45:24 +00:00
- [CSAcademy Disjoint-Set](https://csacademy.com/lesson/disjoint_data_sets)
- [Topcoder Union Find](https://www.topcoder.com/community/data-science/data-science-tutorials/disjoint-set-data-structures/)
- [CPC.3](https://github.com/SuprDewd/T-414-AFLV/tree/master/03_data_structures)
- DSU Complexity Proofs (optional of course)
- [log\*n](https://en.wikipedia.org/wiki/Proof_of_O(log*n)\_time_complexity\_of_union%E2%80%93find)
- [a(m,n)](https://dl.acm.org/doi/pdf/10.1145/321879.321884)
2020-06-22 14:26:06 +00:00
with rollback: https://codeforces.com/contest/1140/problem/F
2020-06-22 01:45:24 +00:00
## Problems
- [Mootube](http://www.usaco.org/index.php?page=viewproblem2&cpid=789)
2020-06-22 14:26:06 +00:00
- same as [CSES Road Construction](https://cses.fi/problemset/task/1676)
2020-06-22 01:45:24 +00:00
- [Closing the Farm](http://www.usaco.org/index.php?page=viewproblem2&cpid=646)
- [CSES Network Breakdown](https://cses.fi/problemset/task/1677)
- [Favorite Colors](http://www.usaco.org/index.php?page=viewproblem2&cpid=1042)
- fairly tricky