Professional Documents
Culture Documents
TWO LISTS
Program :
#include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
struct node
{
int data;
struct node *link;
};
typedef struct node * NODE;
NODE getnode()
{
NODE x;
x = (NODE)malloc(sizeof(struct node));
if(x==NULL)
{
printf("\nInsufficient memory");
exit(0);
}
x->link = NULL;
return x;
}
if(first==NULL)
return temp;
cur = first;
while(cur->link!=NULL)
{
cur = cur->link;
}
cur->link = temp;
return first;
}
void main()
{
int ch, i , n1,n2;
NODE first = NULL;
NODE second =NULL;