Friday, April 17, 2009

C-PROGRAMS/CIRCLE LINKED LIST

#include
#include
#include
#include
struct node
{
int data;
struct node *ptr;
};
typedef struct node NODE;
NODE *first=NULL,*last=NULL;
NODE *nn,*temp,*temp1,*temp2;
main()
{
int ch,r=1;
clrscr();
while(r)
{
printf("enter the choice\n");
printf("1.entering from the front\n");
printf("2.entering from the end\n");
printf("3.deleting from the front\n");
printf("4.deleting from the end\n");
printf("5.display\n");
printf("6.exit\n");
scanf("%d",&ch);
switch(ch)
{
case 1:enterf();
break;
case 2: entere();
break;
case 3:delf();
break;
case 4:dele();
break;
case 5:display();
break;
case 6:return;
}
printf("do you want to continue press 1 for yes and 0 for no\n");
scanf("%d",&r);
}
}

No comments: