aboutsummaryrefslogtreecommitdiff
path: root/src/graph.c
diff options
context:
space:
mode:
authorMikkel Thestrup <mithe24@student.sdu.dk>2025-11-30 14:24:52 +0100
committerMikkel Thestrup <mithe24@student.sdu.dk>2025-11-30 14:24:52 +0100
commita23cb6d6f011950b11789898c10e63f4473a5200 (patch)
treee6f0c3c85e240848a03909639ac227db05f7da2a /src/graph.c
parent06be9b97b3cc575c69d037d6ba09950c0a53d7f3 (diff)
downloadcycle-detector-a23cb6d6f011950b11789898c10e63f4473a5200.tar.gz
cycle-detector-a23cb6d6f011950b11789898c10e63f4473a5200.zip
Updated every file and function to follow style guide
Diffstat (limited to '')
-rw-r--r--src/graph.c16
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) {
+}