Detect Cycle with Disjoint-set Union Find

use Union Find data structure to find a cycle

Last updated