Add single vertex contains method and replace vertices field with adjMatrix' keys
This commit is contained in:
@@ -27,8 +27,8 @@ private:
|
||||
template<typename T>
|
||||
std::map<T, bool> BreadthFirstSearch<T>::initExplore() {
|
||||
std::map<T, bool> graphExplore;
|
||||
for (const auto& v : G.vertices) {
|
||||
graphExplore[v] = false;
|
||||
for (const auto& v : G.adjMatrix) {
|
||||
graphExplore[v.first] = false;
|
||||
}
|
||||
return graphExplore;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user