javascript-algorithms
javascript-algorithms copied to clipboard
Fix BUG in graph reverse method & Add needed tests
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.
Would you please check this PR? @trekhleb