DSU can detect cycles in an undirected graph in O(E·α(N)). When adding edge (u, v), if Find(u) == Find(v) they are already connected — adding this edge would create a cycle.
An undirected edge (u, v) creates a cycle if and only if u and v are already in the same component (same root). This is because there already exists a path between them.