Files
reachability-algorithms/tree/breadth_first_tree.h
2022-07-10 15:32:13 +03:00

30 lines
549 B
C++

#ifndef BREADTH_FIRST_TREE_H_
#define BREADTH_FIRST_TREE_H_
#include "algorithm/bfs.h"
#include "out_tree.h"
using namespace graph;
namespace tree {
template<typename T>
class BreadthFirstTree : public OutTree<T> {
public:
BreadthFirstTree() = default;
BreadthFirstTree(Digraph<T> G);
BreadthFirstTree(std::map<T, std::set<T>> G)
: OutTree<T>::OutTree(G) {}
};
template<typename T>
BreadthFirstTree<T>::BreadthFirstTree(Digraph<T> G) {
auto bfs = algo::BFS<T>(G).run(1);
Graph<T>::adjMatrix = bfs;
}
} // namespace tree
#endif