/*****
deleteatanyindex()
*****/
deleteatanyindex()
{
struct node *temp=head;
while(temp->link->data!=3)
{
temp=temp->link;
}
struct node *temp1=temp->link;
temp->link=temp1->link->link;
free(temp1);
temp1= NULL;
}
deleteatanyindex()
*****/
deleteatanyindex()
{
struct node *temp=head;
while(temp->link->data!=3)
{
temp=temp->link;
}
struct node *temp1=temp->link;
temp->link=temp1->link->link;
free(temp1);
temp1= NULL;
}
2 nodes get deleted by this method
ReplyDelete