Design an algorithm which, given a directed graph G = (V, E) and a particular edge e ∈ E, going from node u to node v determines whether G has a cycle containing e. The running time should be bounded by O(|V | + |E|). Explain why your algorithm runs in O(|V | + |E|) time.

Report
Question

Please briefly explain why you feel this question should be reported.

Report
Cancel

Design an algorithm which, given a directed graph G = (V, E) and a particular edge e ∈ E,
going from node u to node v determines whether G has a cycle containing e. The running time
should be bounded by O(|V | + |E|). Explain why your algorithm runs in O(|V | + |E|) time.

MathJax Example

Answer ( 1 )

  1. Please briefly explain why you feel this answer should be reported.

    Report
    Cancel

    Best answer

Leave an answer

Browse

By answering, you agree to the Terms of Service and Privacy Policy.