Friday, January 31, 2020

6. Insert a New node after any datavalue in SSL

/*****
 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

9_Regular Expressions

Regular expressions- Sometimes in HTML, the developer defines more than one class name ( that’s class input has more than one name Here ...