/*THIS FUNCTION DELETES A NODE */
void delnode(int num, struct node *head)
{
struct node *temp, *m;
temp=head;
while(temp!=NULL)
{
if(temp-%26gt;data==num)
{
if(temp==head)
{
head=temp-%26gt;next;
free(temp);
return;
}
else
{
m-%26gt;next=temp-%26gt;next;
free(temp);
return;
}
}else
{
m=temp;
temp= temp-%26gt;next;
}
}
printf(" ELEMENT %d NOT FOUND ", num);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment