Posts

Showing posts with the label Linked list

Linked list

  //linked list #include <stdio.h> struct node {   int data;   struct node *link; }; struct node *root; void main() {   int a,x;   while ( 1 ) {     printf ( "\n1:add\n" );   printf ( " 2 :display\n" );   printf ( " 3 :delete\n" );   printf ( " 4 :length\n" );   printf ( " 5 :exit\n" );   scanf ( "%d" ,&a);     switch (a)   {     case 1 :add();            break ;     case 2 : display();             break ;     case 3 : delete();             break ;     case 4 : x=length();             printf ( "length=%d\n" ,x);             break ; ...