diff options
| author | Mikkel Thestrup <mithe24@student.sdu.dk> | 2025-11-30 14:24:52 +0100 |
|---|---|---|
| committer | Mikkel Thestrup <mithe24@student.sdu.dk> | 2025-11-30 14:24:52 +0100 |
| commit | a23cb6d6f011950b11789898c10e63f4473a5200 (patch) | |
| tree | e6f0c3c85e240848a03909639ac227db05f7da2a /src/graph.c | |
| parent | 06be9b97b3cc575c69d037d6ba09950c0a53d7f3 (diff) | |
| download | cycle-detector-a23cb6d6f011950b11789898c10e63f4473a5200.tar.gz cycle-detector-a23cb6d6f011950b11789898c10e63f4473a5200.zip | |
Updated every file and function to follow style guide
Diffstat (limited to 'src/graph.c')
| -rw-r--r-- | src/graph.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/graph.c b/src/graph.c new file mode 100644 index 0000000..4be2b44 --- /dev/null +++ b/src/graph.c @@ -0,0 +1,16 @@ +#include "graph.h" +#include <stdlib.h> + +Graph *graph_new(int n) { + Graph *graph = malloc(sizeof(Graph)); + if (!graph) return NULL; + + graph->numEdges = n; + graph->numVertices = 0; + graph->vertices = malloc(sizeof(Vertex[n])); + + return graph; +} + +void graph_add_edge(Graph *g, int i, int j) { +} |