Documentos de Académico
Documentos de Profesional
Documentos de Cultura
NUMEROS ENTEROS*/
#include <stdio.h>
#include <stdlib.h>
#include <conio.c>
struct nodo
{
int info;
nodo *sig;
};
main()
{
nodo *frente,*fondo,*p;
int i,x;
inicializar(frente,fondo);
for (i=0;i<3;i++)
{
printf("Ingrese el valor de x: ");
scanf("%d",&x);
insertar(frente,fondo,x);
}
p=frente;
while (p!=NULL)
{
printf("%d\n",p->info);
p=p->sig;
}
getch();
1
{
frente=NULL;
fondo=NULL;
}
p=new nodo;
if (p!=NULL)
{
p->info=x;
p->sig=NULL;
if (frente==NULL)
frente=p;
else
fondo->sig=p;
fondo=p;
}
else
printf("ERROR - COLA LLENA");
}
if (frente!=NULL)
{
nodo *p;
int x;
p=frente;
x=frente->info;
frente=frente->sig;
delete p;
if (frente==NULL)
fondo=NULL;
return x;
}
else
{
printf("ERROR - PILA VACIA");
2
return 0;
}
}