A
aninnymouse
I'm using a library that provides the following function which
traverses the graph and calls a provided callback function on each
visited vertex:
void depth_first_search(Graph *graph, VertexCB callback, void *data);
Can somebody tell me how I can create a function that implements an
interator iterface using the above function. I'm hoping it's possible
to use it like so:
Vertex *v;
while (v = dfs_iterator()) { }
traverses the graph and calls a provided callback function on each
visited vertex:
void depth_first_search(Graph *graph, VertexCB callback, void *data);
Can somebody tell me how I can create a function that implements an
interator iterface using the above function. I'm hoping it's possible
to use it like so:
Vertex *v;
while (v = dfs_iterator()) { }