lol
This commit is contained in:
11
structs.c
11
structs.c
@@ -52,6 +52,17 @@ void add_edge(graph_t *graph, int src, int dest)
|
||||
graph->adj_lists[dest] = new_node;
|
||||
}
|
||||
|
||||
int has_edge(const graph_t *graph, int u, int v)
|
||||
{
|
||||
node_t *n = graph->adj_lists[u];
|
||||
while (n) {
|
||||
if (n->id == v)
|
||||
return 1;
|
||||
n = n->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
graph_t *basic_graph()
|
||||
{
|
||||
clock_t start, end;
|
||||
|
||||
Reference in New Issue
Block a user