Documente Academic
Documente Profesional
Documente Cultură
Laborator 1
Laborator 1
Laborator 1
#include<stdio.h>
#include<conio.h>
#include<alloc.h>
#define MaxVertex 20
struct muchie{
int sursa;
int dest;
};
typedef struct muchie muchie;
struct list{
int val;
struct list *next;
};
1
Algoritmica grafelor
aux->val=e.dest;
aux->next=NULL;
if(temp==NULL)
(*g)[e.sursa]=aux;
else
{ while(temp->next!=NULL)
temp=temp->next;
temp->next=aux;
}
}
2
Algoritmica grafelor
{ aux=temp->next;
free(temp);
temp=aux;
}
}
}
void main()
{
graph g;
initGraph(&g);
printf("\nCitie graf. Terminati cu nod<0\n");
citireGraph(&g);
printf("\nGraful citit este:");
printGraph(&g);
destroyGraph(&g);
getch();
}