Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int validar_depend_circular(){ //Bueno
- int res=0,i,j,k,l;
- trab *nodo, *nodo2;
- for(i=0; i<queue_size(tbd_queue); i++){
- nodo=(trab*)queue_at(tbd_queue, i);
- char *aux=(char*)malloc(MAX_LINE_SIZE+1*sizeof(char));
- aux=nodo->llave;
- printf("primer nodo llave; %s\n", aux);
- for(j=0; j<queue_size(nodo->depend); j++){
- char *aux2=(char*)malloc(MAX_LINE_SIZE+1*sizeof(char));
- aux2=(char *)queue_at(nodo->depend, j); //Cada dependencia de cada nodo
- printf("nodo depen de llave 1; %s... %s\n", aux, aux2);
- for(k=0; k<queue_size(tbd_queue); k++){
- nodo2=(trab*)queue_at(tbd_queue, k);
- char *aux3=(char*)malloc(MAX_LINE_SIZE+1*sizeof(char));
- aux3=nodo2->llave;
- printf("segundo nodo llave 2; %s\n", aux3);
- if (strcmp(aux2,aux3) == 0){
- for(l=0; l<queue_size(nodo2->depend); l++){
- char *aux4=(char*)malloc(MAX_LINE_SIZE+1*sizeof(char));
- aux4=(char *)queue_at(nodo2->depend, l); //Cada dependencia de cada nodo
- printf("dependencias nodo 2; %s... %s\n", aux3, aux4);
- if (strcmp(aux4,aux) == 0){
- printf("existe\n");
- res=1;
- return res;
- }
- }
- break;
- }
- }
- }
- }
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement