javascript-algorithms icon indicating copy to clipboard operation
javascript-algorithms copied to clipboard

Fix BUG in graph reverse method & Add needed tests

Open itsamirhn opened this issue 3 years ago • 1 comments

This PR fix the issue in #873.

The issue was in the old reverse method, edges reversed one by one and this was making issue for graphs with cycle of length 2. For example, when graph with only two edges AB and BA was reversing, on reversing AB, BA was exist and there will be crash.

itsamirhn avatar Jul 30 '22 10:07 itsamirhn

Would you please check this PR? @trekhleb

itsamirhn avatar Apr 04 '23 07:04 itsamirhn