DirectedEdge::DirectedEdge

Constructor


DirectedEdge(T vertexX, T vertexY);
DirectedEdge(T vertexX, T vertexY, double W);

Constructs a directed edge. T is the type of label of the endpoints. Default value of the weight of edge is 1.

Parameters

None

Return value

None

Example

#include "HKUAL_graph.h"
#include <iostream>
using namespace std;
using namespace HKUAL;

int main(){
    DirectedEdge<string> E1("A", "B");
    DirectedEdge<int> E2(1, 2, 1.2);
    return 0;
}

Output

None

Time Complexity

© The University of Hong Kong Algorithms Library - hkual@cs.hku.hk