Category "union-find"

Can we detect cycles in directed graph using Union-Find data structure?

I know that one can detect cycles in direct graphs using DFS and BFS. I want to know whether we can detect cycles in directed graphs using Union-Find or not? I

How to generate the worst case for disjoint set with only path compression?

A disjoint set with only path compression implemented is like this: // In cpp. int Find(int x) { return f[x] == x ? x : f[x] = Find(f[x]); } int Union(int a, i