Esempio n. 1
0
int main(){
    //tamVariables();
    ptrNodo ptrRaiz = NULL; //apuntador a la raiz

    imprimeLista(ptrRaiz);
    insertaNodo(5, &ptrRaiz);
    imprimeLista(ptrRaiz);
    insertaNodo(8, &ptrRaiz);
    imprimeLista(ptrRaiz);


    return 0;
}
Esempio n. 2
0
int main(){

	FILE *fp;
	char cadena[100];
	struct Alumno *inges, *lista, *temp;

	fp=fopen("alumnos.txt", "r");

	lista = creaNodo();

	if(fp==NULL){
		printf("No existe el archivo LOL!!");
		return 0;
	}


	while(!feof(fp)){
		inges = creaNodo();
		fscanf(fp, "%s\n", cadena);
		corta(cadena, inges);
		insertaNodo(lista, inges);
		printf("%s\n",inges->nombre); 
	}

	temp = lista->sig;
	muestraLista(temp);

	fclose(fp);


	return 0;
}
int capturaLista( LISTA *lA, LISTA *lB, int *nEa, int *nEb )
{
  int resIgual, opc, numAux;
  
  do
  {
    opc = imprimeMenu();
    
    switch( opc )
    {
       case 1: numAux = leerNum();
               insertaNodo( lA, numAux, nEa );
               printf( "\n Nodos de A: %d ", *nEa );
               system( "pause" );
               break;
       case 2: numAux = leerNum();
               insertaNodo( lB, numAux, nEb );
               printf( "\n Nodos de B: %d ", *nEb );
               system( "pause" );
               break;
       case 3: resIgual = determinaIgualdad( *lA, *lB, *nEa, *nEb );
               
               if( resIgual == 1 )
                    printf( "\n Las lista son iguales " );
               else
                  printf( "\n Las lista son diferentes " );
              
               system( "pause" );
               
               break;
       case 4: imprimeLista( *lA, *lB );
               break;
    }
 
  }while( opc > 0 && opc < 5 );
  
  return( resIgual );  
}
int main()
{
  LISTA ptrLista;
  
  ptrLista = NULL;
  
  insertaNodo( &ptrLista );
  
  imprimeLista( ptrLista );
  
  imprimeCuenta( cuentaNodo( ptrLista ) );
  
  system( "pause" );
} 
void procesaLista( LISTA *lA )
{
  int orden, opc, numAux;
  
  do
  {
    opc = imprimeMenu();
    
    switch( opc )
    {
       case 1: numAux = leerNum();
               insertaNodo( lA, numAux );
              // printf( "\n Nodos de A: %d ", *nEa );
               system( "pause" );
       break;
       
       case 2: imprimeLista( *lA );
               system( "pause" );
       break;
       
       case 3: orden = determinaOrdenRec( *lA );
               
               if( orden == 1 )
                    printf( "\n Las lista esta ordenada crecientemente " );
               else
                  printf( "\n Las lista no esta ordenada ascedentemente " );
              
               system( "pause" );
               break;
      
       case 4: 
               numAux = leerNum();
               if( busquedaRecursiva( *lA, numAux ) )
                    printf( "\n El elemento se ha encontrado " );
               else
                  printf( "\n El dato no esta en la lista " );
              
               system( "pause" );
               break;
       default:
               completaLista( *lA );
                
       
      }
    
    }while( opc > 0 && opc < 6 );
}
Esempio n. 6
0
int main(){
	int valor=1;
	nodo *lista=NULL;
	insertaNodo(lista,(void*)valor);
	return 0;
}