/*****
Assume SSL contains elemenst in following order <1,2,3,4>
inseratanyindex function will insert a new node after data value=2
*****/
void inseratanyindex()
{
printf("\nLets insert a node at the End\n");
struct node *mynode;
struct node *temp=head;
mynode=(struct node *)malloc(sizeof(struct node));
while(temp->data!=2)
{
temp=temp->link;
}
mynode->link=temp->link;
temp->link=mynode;
mynode->data=90;
printf("New Node Inserted Successfuly at the after node 2!\n");
}
Assume SSL contains elemenst in following order <1,2,3,4>
inseratanyindex function will insert a new node after data value=2
*****/
void inseratanyindex()
{
printf("\nLets insert a node at the End\n");
struct node *mynode;
struct node *temp=head;
mynode=(struct node *)malloc(sizeof(struct node));
while(temp->data!=2)
{
temp=temp->link;
}
mynode->link=temp->link;
temp->link=mynode;
mynode->data=90;
printf("New Node Inserted Successfuly at the after node 2!\n");
}
No comments:
Post a Comment