Add BreadthFirstTree's to decremental maintenance algorithm and delete In/Out tree classes
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
#ifndef BREADTH_FIRST_TREE_H_
|
||||
#define BREADTH_FIRST_TREE_H_
|
||||
|
||||
#include "out_tree.h"
|
||||
#include "directed_rooted_tree.h"
|
||||
#include "algorithm/breadth_first_search.h"
|
||||
using namespace graph;
|
||||
|
||||
namespace tree {
|
||||
|
||||
template<typename T>
|
||||
class BreadthFirstTree : public OutTree<T> {
|
||||
class BreadthFirstTree : public DirectedRootedTree<T> {
|
||||
public:
|
||||
BreadthFirstTree() = default;
|
||||
|
||||
BreadthFirstTree(Digraph<T> G, T root);
|
||||
|
||||
BreadthFirstTree(std::map<T, std::set<T>> G)
|
||||
: OutTree<T>::OutTree(G) {}
|
||||
: DirectedRootedTree<T>::DirectedRootedTree(G) {}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
BreadthFirstTree<T>::BreadthFirstTree(Digraph<T> G, T root) {
|
||||
auto bfs = algo::BreadthFirstSearch<T>(G).execute(root);
|
||||
Graph<T>::adjMatrix = bfs;
|
||||
this->adjMatrix = bfs;
|
||||
}
|
||||
|
||||
} // namespace tree
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef IN_TREE_H_
|
||||
#define IN_TREE_H_
|
||||
|
||||
#include "directed_rooted_tree.h"
|
||||
using namespace graph;
|
||||
|
||||
namespace tree {
|
||||
|
||||
template<typename T>
|
||||
class InTree : public DirectedRootedTree<T> {
|
||||
public:
|
||||
InTree() = default;
|
||||
|
||||
InTree(std::map<T, std::set<T>> G)
|
||||
: DirectedRootedTree<T>::DirectedRootedTree(G) {}
|
||||
};
|
||||
|
||||
} // namespace tree
|
||||
|
||||
#endif
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef OUT_TREE_H_
|
||||
#define OUT_TREE_H_
|
||||
|
||||
#include "directed_rooted_tree.h"
|
||||
using namespace graph;
|
||||
|
||||
namespace tree {
|
||||
|
||||
template<typename T>
|
||||
class OutTree : public DirectedRootedTree<T> {
|
||||
public:
|
||||
OutTree() = default;
|
||||
|
||||
OutTree(std::map<T, std::set<T>> G)
|
||||
: DirectedRootedTree<T>::DirectedRootedTree(G) {}
|
||||
};
|
||||
|
||||
} // namespace tree
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user