<分区>
我正在从极客到极客学习图(邻接表),我看到了这段代码:
// A structure to represent an adjacency list node
struct AdjListNode
{
int dest;
struct AdjListNode* next;
};
// A structure to represent an adjacency liat
struct AdjList
{
struct AdjListNode *head; // pointer to head node of list
};
// A structure to represent a graph. A graph is an array of adjacency lists.
// Size of array will be V (number of vertices in graph)
struct Graph
{
int V;
struct AdjList* array;
};
我想知道两者之间的区别:
struct AdjListNode* next;
和struct AdjListNode *head;
和struct AdjListNode * head;