Make class Graph abstract and make derived classes Digraph and SCC
This commit is contained in:
26
graph/digraph.h
Normal file
26
graph/digraph.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef DIGRAPH_H_
|
||||
#define DIGRAPH_H_
|
||||
|
||||
#include "graph.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace graph {
|
||||
|
||||
template<typename T>
|
||||
class Digraph : public Graph<T> {
|
||||
public:
|
||||
Digraph() = default;
|
||||
|
||||
// Reverse graph directions
|
||||
Digraph<T> reverse();
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
Digraph<T> Digraph<T>::reverse() {
|
||||
return Digraph<T>();
|
||||
}
|
||||
|
||||
} // namespace graph
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user