|
|
вернуться в форумO(N^2). Is there better solution? I divided given graph into biconnected components, and then worked with created DAG. This solution is O(N^2) and runs in 0.203 seconds. But there are solutions with better time. Is there faster algo for this problem? P.S. sorry for bad english(( Re: O(N^2). Is there better solution? The input in this problem requires O(N^2) time, so the better complexity cannot be achieved :) Re: O(N^2). Is there better solution? Your solution O(N^2*log(N)) in worst case, because the input in this problem requires O(N^2*log(N)) time, so the better complexity than it cannot be achieved. Re: O(N^2). Is there better solution? How to divide graph into connected components in O(N^2)? Re: O(N^2). Is there better solution? Послано JTim 7 авг 2010 01:27 You can use Tarjan's algorithm to find strongly connected components Re: O(N^2). Is there better solution? Yes! O(1) |
|
|