Professional Documents
Culture Documents
#include <stdio.h>
#include <conio.h>
#include <alloc.h>
void main( )
{
struct node *p ;
p = NULL ; /* empty linked list */
display ( p ) ;
display ( p ) ;
addafter ( p, 7, 0 ) ;
addafter ( p, 2, 1 ) ;
addafter ( p, 5, 99 ) ;
display ( p ) ;
printf ( "\nNo. of elements in the Linked List = %d", count ( p ) ) ;
delete ( &p, 99 ) ;
delete ( &p, 1 ) ;
delete ( &p, 10 ) ;
display ( p ) ;
printf ( "\nNo. of elements in the Linked List = %d", count ( p ) ) ;
}
/* go to last node */
while ( temp -> link != NULL )
temp = temp -> link ;
temp = q ;
/* skip to desired portion */
for ( i = 0 ; i < loc ; i++ )
{
temp = temp -> link ;
return c ;
}
temp = *q ;