This commit is contained in:
Tiago Batista Cardoso
2026-02-28 22:41:19 +01:00
parent 500e03af35
commit 2d3865079d
21 changed files with 1072 additions and 570 deletions

View File

@@ -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;