typedef int type; typedef struct GRAPH{ int vertices; int** matrix; int* visited; }GRAPH; GRAPH* createGraph(int vertices, int** nmatrix){ GRAPH* newGraph = (GRAPH*) malloc(sizeof(GRAPH)); newGraph->vertices = vertices; newGraph->matrix = nmatrix; newGraph->visited = (int*) malloc(sizeof(int)*vertices); for(int i=0; ivisited[i] = 0; } return newGraph; } void resetVisited(GRAPH* g){ for(int i=0; ivertices; i++){ g->visited[i]=0; } } void DFS(GRAPH* g, int vertex){ } typedef struct NODE{ int data; NODE* next; }; typedef struct QUEUE{ int size; NODE* head; }; void MakeEmptyQueue(QUEUE* q){ q->size = 0; q->head = NULL; } bool IsEmptyQueue(QUEUE* q){ return q->size==0; } void Enqueue(QUEUE* q, int x){ NODE* tmp = q->head; NODE* newNode = (NODE*) malloc(sizeof(NODE)); newNode->data = x; newNode->next = NULL; if(IsEmptyQueue(q)) q->head = newNode; else { while(tmp->next!=NULL){ tmp = tmp->next; } tmp->next = newNode; } q->size++; } int Dequeue(QUEUE* q){ NODE* tmp = q->head; int result=-1; if(!IsEmptyQueue(q)){ result = tmp->data; q->head = q->head->next; free(tmp); q->size--; } return result; } void PrintQueue(QUEUE* q){ NODE* tmp = q->head; for(int i=0; isize; i++){ printf("%d ", tmp->data); tmp = tmp->next; } printf("\n"); } void BFS(GRAPH* g, int vertex){ } int main(int argc, char* argv[]) { int vertices = 8; int** neighbors = (int**) malloc(sizeof(int)*vertices); for(int i=0; i