Skip to main content

Posts

Showing posts from September 9, 2017

SINGLY LINK LIST

DOWNLOAD FULL PROGRAME CODING: #CREATE A LIST struct node *creatlist(struct node *start) { struct node *new_node; int num; printf("\nENTER '-1' FOR SAVE THE LIST."); printf("\nEnter The Number:"); scanf("%d",&num); while(num!=-1) { new_node=(struct node*)malloc(sizeof(struct node*)); new_node->no=num; if(start==NULL) {   new_node->next=NULL;   start=new_node;   cu++; } else {   new_node->next=start;   start=new_node;   cu++; } printf("Enter The Number:"); scanf("%d",&num); } return start; } #TRAVERSAL struct node *display(struct node *start) { struct node *ptr; ptr=start; printf("\nLIST OPEN...\n"); while(ptr!=NULL) {   printf("\n %d",ptr->no);   ptr=ptr->next; } return start; } #INSERT AT FIRST struct node *inserrecord(struct node *start) { int no; struct node *new_record; printf("\nEnter The Number:"); scanf("%d"

DOUBLY LINK LIST

DOWNLOAD FULL PROGRAME CODING: #CREATE A LIST struct node *create(struct node *start) { struct node *new_node; int num,n; printf("\nHOW MANY ENTER THE RECORD IN LIST :"); scanf("%d",&n); do { printf("Enter the number:"); scanf("%d",&num);  if(start==NULL)  {   start=(struct node *)malloc(sizeof(struct node *));   start->prev=NULL;   start->data=num;   start->next=NULL;   count++;   n--;  }  else  {   new_node=(struct node *)malloc(sizeof(struct node *));   new_node->prev=NULL;   new_node->data=num;   new_node->next=start;   start->prev=new_node;   start=new_node;   count++;   n--;  } }while(0<n); return start; } #INSERT AT FIRST struct node *insert_beg(struct node *start) { struct node *new_node; int num; printf("Enter The Number:"); scanf("%d",&num); new_node=(struct node *)malloc(sizeof(struct node *)); start->prev=new_node; new_node->