h>
#include<stdio.h>
#include<malloc.h>
struct node
int data;
node *link;
};
node *front=NULL;
node *rear=NULL;
void insertion()
node *temp;
scanf("%d",&temp->data);
temp->link=NULL;
if(front==NULL)
front=temp;
rear=temp;
else
rear->link=temp;
rear=rear->link;
}
}//end insertion
void deletion()
node *temp;
if(front==NULL)
else
temp=front;
front=front->link;
printf("%d\n",temp->data);
free(temp);
if(front==NULL)
rear=NULL;
}//end delete
void display()
node *temp;
if(front==NULL)
}
else
temp=front;
while(temp!=NULL)
printf("%d\n",temp->data);
temp=temp->link;
}//end display
scanf("%d",&pilih);
return pilih;
void daftar()
printf("Daftar pilihan\n");
printf("\t\t1).Insertion\n");
printf("\t\t2).Deletion\n");
printf("\t\t3).Display\n");
printf("\t\t4).search value\n");
void searchvalue()
node *temp;
int nilai=0;
int i=0;
int j=0;
if(front==NULL)
else
scanf("%d",&nilai);
temp=front;
while(temp!=NULL)
j++;
if(nilai == temp->data)
i++;
temp=temp->link;
}//end while
}//end else
int main()
{
int pilih;
char jawab;
daftar();
do
pilih=pilihan(pilih);
switch(pilih)
case 1:
insertion();
break;
case 2:
deletion();
break;
case 3:
display();
break;
case 4:
searchvalue();
break;
}
scanf(" %c",&jawab);
while(jawab=='y');
getch();
return 0;