阅读背景:

c ++:在图类中的广度优先搜索中的分段错误

来源:互联网 

I am a bit experienced in c++ and tried to implement a graph class with nodes which are numbered from 1 to n (and every edge is weighted with 6) with a method to find all reachable nodes from a given one by breadth depth first. However, in some testcases I get a segmentation fault and don't know why. The error seems to happen when i push the next node to visit into the queue - if I comment out this line, the program works. I used heap storage to avoid any problems with any empty pointers, still I get this kind of fault. I would be thankful for any help.I am a bit experienced in c++ and tried to impl




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: