cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Code Problem
Code Problem
Apr 1, 2016 at 2:50pm UTC
brandon66
(1)
here
Last edited on
Apr 5, 2016 at 1:45pm UTC
Apr 1, 2016 at 6:26pm UTC
dhayden
(5798)
For BFS i am getting 1,2,4,5,7,6 Should i be getting 1,2,3,4,5,6?
When creating the edge list, you insert the nodes at the front of the list, so the list for node 1 is 2,4,3 instead of 3,4,2. That's why the results are the way they are.
Apr 1, 2016 at 6:33pm UTC
dhayden
(5798)
You push nodes at the front of the adjacency list, so the list for node 1 is 2,4,3, not 3,4,2. That's why your results aren't what you expect.
Last edited on
Apr 1, 2016 at 6:33pm UTC
Topic archived. No new replies allowed.