#include<stdio.h>
struct node
{
int info;
struct node *next;
};
typedef struct node *newnode;
newnode first,newn,pred,temp,avail,save;
void main()
{
int i,n,w,q,y,x;
clrscr();
textcolor(11);
first=NULL;
avail=(newnode)malloc(sizeof(struct node));
avail->next=NULL;
printf("\n\n\t\tENTER VALUE OF NODE WHICH YOU WANT TO CREATE NODE SPACE>>");
scanf("%d",&n);
temp=avail;
for(i=1;i<n;i++)
{
temp->next=(newnode)malloc(sizeof(struct node));
temp=temp->next;
temp->next=NULL;
}
getch();
}
struct node
{
int info;
struct node *next;
};
typedef struct node *newnode;
newnode first,newn,pred,temp,avail,save;
void main()
{
int i,n,w,q,y,x;
clrscr();
textcolor(11);
first=NULL;
avail=(newnode)malloc(sizeof(struct node));
avail->next=NULL;
printf("\n\n\t\tENTER VALUE OF NODE WHICH YOU WANT TO CREATE NODE SPACE>>");
scanf("%d",&n);
temp=avail;
for(i=1;i<n;i++)
{
temp->next=(newnode)malloc(sizeof(struct node));
temp=temp->next;
temp->next=NULL;
}
getch();
}
No comments:
Post a Comment