Add structs to track traversal information in object-graph example

+ Allows Graph member functions to remain const
+ Easy to pass traversal information around as needed
+ Update DFS and BFS functions to return traversal information
This commit is contained in:
2021-07-12 16:52:49 -04:00
parent 2a36de7c52
commit 64df3419a0
3 changed files with 87 additions and 76 deletions

View File

@@ -45,7 +45,6 @@ int main (const int argc, const char * argv[])
// The graph traversed in this example is seen in MIT Intro to Algorithms
// + Chapter 22, Figure 22.3 on BFS
bfsGraph.BFS(bfsGraph.GetNodeCopy(2));
Node test = bfsGraph.GetNodeCopy(3);
std::cout << "\nTesting finding a path between two nodes using BFS...\n";
// Test finding a path between two nodes using BFS