Name
graph_destroy
Synopsis
void graph_destroy(Graph *graph
);
Return Value
None.
Description
Destroys the graph specified by
graph
. No other operations are
permitted after calling graph_destroy unless
graph_init is called again. The
graph_destroy operation removes all vertices
and edges from a graph and calls the function passed as
destroy
to
graph_init once for each vertex or edge as it
is removed, provided destroy
was not
set to NULL.
Complexity
O (V +E ), where V is the number of vertices in the graph and E is the number of edges.
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.