#include #include #include #include "graph.h" // insere um nó no início da lista ALNode *addList(ALNode *list, int node, Info p) { ALNode *aux; aux = (ALNode*) malloc(sizeof(ALNode)); aux->vert = node; aux->info = p; aux->next = list; return aux; } ALNode *findList(ALNode *list, int node) { ALNode *aux; for (aux=list; aux!=NULL ; aux=aux->next) if (aux->vert == node) return aux; return NULL; } void freeList(ALNode *list) { if (list!=NULL) { freeList(list->next); free(list); } } ALNode *dupList(ALNode *list) { ALNode *aux=NULL; if (list!=NULL) { aux = (ALNode*) malloc(sizeof(ALNode)); aux->vert = list->vert; aux->info = list->info; aux->next = dupList(list->next); } return aux; } AMGraph converse_am(AMGraph g) { int i,j,aux; for (i=0; ivert,node->info); showList(node->next); } } void show_al(ALGraph g) { int i; printf("\n"); for (i=0; i