Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Convert to the DAG by merging together nodes in the same strongly connected component in a supernode.
- 2. If there are two or more leaf supernodes, output any one node from two different leaf supernodes.
- 3. Otherwise, if there is a node with in-degree > 1, output any one node from its two different children.
- 4. Otherwise, there is no such pair.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement