79569399

Date: 2025-04-11 17:17:55
Score: 2
Natty:
Report link

​Union-Find is designed for undirected graphs to manage disjoint sets and detect cycles. It doesn't account for edge direction, which is crucial in directed graphs. Therefore, using Union-Find to find roots in a directed graph isn't appropriate. Instead, consider computing the in-degree of each node; nodes with an in-degree of zero are potential roots.

Reasons:
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: robin chaillou