I need some help, I'm trying to create an adjacency list to represent a graph in C, I can add one edge to each node list, but I have no idea how to add more than one, I also dont know how to delete an edge , this is what I've got
edit 1 * I create the list inside the main function like an array: List *adjlist[Max]= {0};
typedef struct Node{
int vertexNum;
struct Node *next;
} Node;
typedef struct List{
Node *head;
} List;
void Connect(List **adjlist, int v1, int v2){
Node *dest, *tmp, *src;
if(adjlist[v1]->head == NULL){
src= (Node *)malloc(sizeof(Node));
src->vertexNum = v2;
src->next = NULL;
adjlist[v1]->head=src;
}
dest = (Node *)malloc(sizeof(Node));
dest->vertexNum = v2;
dest->next=NULL;
tmp=adjlist[v1]->head;
while(tmp->next != NULL){
tmp= tmp->next;
}
adjlist = tmp;
}