Page 106 - DCAP407_DATA_STRUCTURE
P. 106

Unit 6: Linked List Operations



                               {
                                  printf("The linked list is:\n");
                                  display();
                               }

                                  getch();
                                  clrscr();
                                  menu();
                                  break;
                               case 3:
                                   clrscr();
                                   printf("\n Enter the number to be inserted: ");
                                   scanf("%d",&num);

                                   insert_beg(num);
                                   clrscr();
                                   printf("\n After insertion at the beginning the linked list is:\n");
                                  display();
                                  getch();
                                  clrscr();

                                  menu();
                                  break;
                               case 4:
                                  exit(1);
                               default:
                                  clrscr();
                                  printf("Your choice is wrong\n\n");

                                  menu();
                               }
                               }
                               void createnode()
                               {
                                  int num;

                                  char ch;
                                  clrscr();
                                  newnode=(struct list*)malloc(sizeof(struct list));
                                  HEAD=newnode;
                                  do
                               {





                                        LOVELY PROFESSIONAL UNIVERSITY                           99
   101   102   103   104   105   106   107   108   109   110   111