
250 Data Structures Using C
if (newStud.roll > back->roll&& newStud.roll <ptr->roll)
{
*flag=1;
break; /* The location of the insertion found*/
}
back =ptr;
}
if (*flag==1)
{
Far = (struct student *) malloc (Sz);
/* Read Data of student for insertion */
strcpy(Far->name, newStud.name);
Far->roll = newStud.roll;
Far->next = ptr; /* Insert node */
back->next = Far;
}
}
ptr = First;
return ptr;
}
void dispList(struct student *First) /* Here any of the dispList() function
designed in above examples can be used */
{
}
6.3.5 Deleting a Node from a Linked List
A delete operation involves ...