Name
graph_adjlist
Synopsis
int graph_adjlist(const Graph *graph
, const void *data
, AdjList **adjlist
);
Return Value
0 if retrieving the adjacency list is successful, or -1 otherwise.
Description
Retrieves vertices that are adjacent to the vertex specified
by data
in
graph
. The adjacent vertices are
returned in the form of an AdjList
structure, a structure containing the vertex matching
data
and a set of vertices adjacent to
it. A pointer to the actual adjacency list in the graph is
returned, so it must not be manipulated by the caller.
Complexity
O (V ), where V is the number of vertices in the graph.
Get Mastering Algorithms with C now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.