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.h | |
| 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.h')
| -rw-r--r-- | src/Graph.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/Graph.h b/src/Graph.h deleted file mode 100644 index 3e7cfaa..0000000 --- a/src/Graph.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef GRAPH_H -#define GRAPH_H - -#include "LinkedList.h" - -typedef struct Vertex Vertex; -typedef struct Graph Graph; -struct Vertex { - int id; // a number in [0; numVertices[ - LinkedList *outNeighbours; // A linked list of vertices. - LinkedList *inNeighbours; // A linked list of vertices -}; - -struct Graph { - int numVertices; - int numEdges; - Vertex *vertices; // An array of numVertices vertices -}; - -// Allocates and constructs a new graph with n vertices. -// Returns a pointer to the new graph, or NULL on error. -// Post: the caller owns the graph. -Graph *Graph_new(int n); - -// Adds an edge from the i'th to the j'th vertex (0-indexed). -void Graph_addEdge(Graph *g, int i, int j); - -// Reads a graph from the given file and returns a newly -// constructed Graph representing it. -// Returns a pointer to the read graph, or NULL on error. -// Post: the caller owns the graph. -Graph *Graph_read(const char *filename); - -// Deallocates the given graph and all its associated memory. -void Graph_delete(Graph *g); - -// Prints some useful information about the given graph. -void Graph_print(Graph *g); - -#endif // GRAPH_H |