This document discusses the disjoint set union (DSU) data structure, including when it is required, techniques for finding parents such as path compression, union by size and rank for optimization, a code template, and example problems from Codeforces and SPOJ where DSU can be applied.
This document discusses the disjoint set union (DSU) data structure, including when it is required, techniques for finding parents such as path compression, union by size and rank for optimization, a code template, and example problems from Codeforces and SPOJ where DSU can be applied.
This document discusses the disjoint set union (DSU) data structure, including when it is required, techniques for finding parents such as path compression, union by size and rank for optimization, a code template, and example problems from Codeforces and SPOJ where DSU can be applied.
Expert at codeforces (1817) 5 star at codechef (2049) Disjoint Set Union ● When is DSU required? ● How to find parent? (Path Compression technique) ● Union by size ● Union by rank ● Code Template of DSU ● Codeforces Problem ● SPOJ problem