Add vertices without arcs into the BFTree

This commit is contained in:
stefiosif
2022-09-14 19:41:08 +03:00
parent 42f824a249
commit 0ffc20496d
2 changed files with 5 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ std::map<T, std::set<T>> BreadthFirstSearch<T>::execute(const T& root) {
if (!visited[u]) {
visited[u] = true;
tree[v].insert(u);
tree[u];
Q.push(u);
}
}