Algorithms_in_C  1.0.0
Set of algorithms implemented in C.
graph.h
1 // Graph ADT interface ... COMP2521
2 #include <stdbool.h>
3 
4 typedef struct GraphRep *Graph;
5 
6 // vertices are ints
7 typedef int Vertex;
8 
9 // edges are pairs of vertices (end-points)
10 typedef struct Edge
11 {
12  Vertex v;
13  Vertex w;
14 } Edge;
15 
16 Graph newGraph(int);
17 void insertEdge(Graph, Edge);
18 void removeEdge(Graph, Edge);
19 bool adjacent(Graph, Vertex, Vertex);
20 void showGraph(Graph);
21 void freeGraph(Graph);
22 
23 // By
24 // .----------------. .----------------. .----------------.
25 // .-----------------. .----------------. .----------------.
26 // | .--------------. || .--------------. || .--------------. ||
27 // .--------------. | | .--------------. || .--------------. | | | _________ |
28 // || | _____ _____ | || | __ | || | ____ _____ | | | | ____ ____
29 // | || | ____ | | | | | _ _ | | || ||_ _||_ _|| || | / \
30 // | || ||_ \|_ _| | | | | |_ || _| | || | .' `. | | | | |_/ | |
31 // \_| | || | | | | | | || | / /\ \ | || | | \ | | | | | | |
32 // |__| | | || | / .--. \ | | | | | | | || | | ' ' | | || |
33 // / ____ \ | || | | |\ \| | | | | | | __ | | || | | | | | | |
34 // | | _| |_ | || | \ `--' / | || | _/ / \ \_ | || | _| |_\ |_
35 // | | | | _| | | |_ | || | \ `--' / | | | | |_____| | || | `.__.'
36 // | || ||____| |____|| || ||_____|\____| | | | | |____||____| | || | `.____.'
37 // | | | | | || | | || | | || | | | | |
38 // | || | | | | '--------------' || '--------------' ||
39 // '--------------' || '--------------' | | '--------------' || '--------------'
40 // |
41 // '----------------' '----------------' '----------------'
42 // '----------------' '----------------' '----------------'
43 
44 // Email : z5261243@unsw.edu.au
45 // hhoanhtuann@gmail.com
node
Node, the basic data structure in the tree.
Definition: binary_search_tree.c:15
newNode
node * newNode(int data)
The node constructor, which receives the key value input and returns a node pointer.
Definition: binary_search_tree.c:28
queue
Definition: bfs.c:6
main
int main()
Driver code.
Definition: client.c:70
GraphRep
Definition: graph.c:9
hash_set_t
Definition: hash_set.h:7
display
void display(double **A, int N)
Function to display square matrix.
Definition: lu_decompose.c:66
dynamic_array
Definition: dynamic_array.h:7
Edge
Definition: bellman_ford.c:8
Graph
Definition: bellman_ford.c:14
print
void print(CantorSet *head)
Print sets in the current range to stdout
Definition: cantor_set.c:55