Making an adjacency list in C++ for a directed graph

后端 未结 5 2006
隐瞒了意图╮
隐瞒了意图╮ 2021-01-02 01:19

Hello all :) Today I am refining my skills on graph theory and data structures. I decided to do a small project in C++ because it\'s been a while since I\'ve worked in C++

5条回答
  •  时光取名叫无心
    2021-01-02 01:30

    I suggest you adding in the node structure, the Adjacency List And define the graph structure as List of Nodes instead of List of Adjacency Lists :)

    struct node {
        int vertex;
        node* next;
        adjList m_neighbors;
    };
    struct graph{
        //List of nodes
    };
    

提交回复
热议问题