Use clang-format

This commit is contained in:
stefiosif
2024-08-03 13:14:42 +03:00
parent d216a9611f
commit 3951db7ff9
17 changed files with 262 additions and 287 deletions

View File

@@ -5,30 +5,28 @@
namespace graph {
template<typename T>
class BreadthFirstTree : public Digraph<T> {
template <typename T> class BreadthFirstTree : public Digraph<T> {
public:
BreadthFirstTree() = default;
BreadthFirstTree(std::unordered_map<T, std::unordered_set<T>> G, T root)
: BreadthFirstTree<T>(Digraph<T>(G), root) {}
: BreadthFirstTree<T>(Digraph<T>(G), root) {}
BreadthFirstTree(Digraph<T> G, T root);
void removeEdgeTo(const T& u);
void removeEdgeTo(const T &u);
T root{};
};
template<typename T>
template <typename T>
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]) {
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;