Constructor
Directedgraph();
Constructs a directed graph.
None
Example
#include "HKUAL_graph.h" #include <iostream> using namespace std; using namespace HKUAL; int main(){ DirectedGraph<string> g; g.addVertex("A"); g.addVertex("B"); g.addVertex("C"); g.addEdge("A","B"); g.addEdge("A","C"); DirectedGraph<int> g2; g2.addVertex(1); g2.addVertex(2); g2.addVertex(3); g2.addEdge(1,2); g2.addEdge(1,3); return 0; }
Output
Time Complexity