Improve readability
This commit is contained in:
@@ -15,7 +15,9 @@ public:
|
||||
|
||||
BreadthFirstTree(Digraph<T> G, T root);
|
||||
|
||||
T root;
|
||||
void removeEdgeTo(const T& u);
|
||||
|
||||
T root{};
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
@@ -23,6 +25,18 @@ BreadthFirstTree<T>::BreadthFirstTree(Digraph<T> G, T root) {
|
||||
this->adjList = algo::BreadthFirstSearch<T>(G.adjList).execute(root);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void BreadthFirstTree<T>::removeEdgeTo(const T& u) {
|
||||
for (const auto& x : this->vertices()) {
|
||||
for (const auto& y : this->adjList[x]) {
|
||||
if (y == u) {
|
||||
this->remove(x, u);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace graph
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user