Directed graph implementation

前端 未结 5 2157
余生分开走
余生分开走 2020-12-28 11:56

I need to implement a digraph(Directed graph) in c++ as part of a homework and I\'m having some issues with how to represent the vertices and edges data types.
Can anybo

5条回答
  •  轮回少年
    2020-12-28 12:10

    template
    class node
    {
    public:
        T data;
        vector*> edges;
    }
    

    You will most likely also want to store a list*> of all the nodes.

提交回复
热议问题