way-to-algorithm icon indicating copy to clipboard operation
way-to-algorithm copied to clipboard

欧拉回路代码错误

Open EternalWang opened this issue 4 years ago • 1 comments

这里的dfs函数只是做了一个简单的深度优先遍历节点,path并不是最终的回路,比如下面这个测试样例的path结果就不正确:

{
    {
        {0, 1, 1, 0, 0},
        {1, 0, 1, 1, 1},
        {1, 1, 0, 0, 0},
        {0, 1, 0, 0, 1},
        {0, 1, 0, 1, 0},
    },
    5,
    true,
},

此外,EulerCycleTest.cpp中的倒数第二个测试样例也不对,节点数和图不符。

EternalWang avatar Jun 06 '20 03:06 EternalWang

我最近的精力已经没有再继续维护了,等我有时间会再看下这个问题。如果您有兴趣也可以提交PR给我!

linrongbin16 avatar Jun 06 '20 03:06 linrongbin16