/*****
deletnodefrombegning()
*****/
deletnodefrombegning()
{
struct node *temp=head;
if(head== NULL)
{
printf("THERE IS NO NODE TO DELETE\n");
}
if(head->link==NULL) // there is only one node
{
free(head);
head=NULL;
}
head=head->link;
free(temp);
}
deletnodefrombegning()
*****/
deletnodefrombegning()
{
struct node *temp=head;
if(head== NULL)
{
printf("THERE IS NO NODE TO DELETE\n");
}
if(head->link==NULL) // there is only one node
{
free(head);
head=NULL;
}
head=head->link;
free(temp);
}
No comments:
Post a Comment