SlideShare uma empresa Scribd logo
1 de 58
Double Linked List
#include<stdio.h>
#include<conio.h>
#include<process.h>
#include<alloc.h>

struct node
{
   int data;
   struct node *prev,*next;
}*start=NULL,*p,*q, *r, *New;
int item, pos, c=0, i;
Double Linked List
void main()
{
   int ch;
   clrscr();
   do
   {
          printf("n***MENU***");
          printf("n1.Insertn2.Deleten3.Searchn4.Displayn5.Exit");
          printf("nPlease Enter the choice...");
          scanf("%d",&ch);               1
          switch(ch)
          {
          case 1:insert();break;
          case 2:del();break;
          case 3:search();break;
          case 4:disp();break;
          case 5:exit(0);
          default:printf("nInvalid Choice...n");
          }
   }while(ch!=5);
   getch();
}
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);             1                              for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
            {
                                                               printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
            }
                                                         }




    New
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);            10                      c++;
      if(pos==1)
                                                               }
            {
                                                               printf("nData Inserted Successfully );
                       New->next=start;
                                                             }
                       start->prev=New;
                                                             else
                       start=New;
                                                             printf("nInvalid Position...n");
                       c++;
            }
                                                         }




    New                    10
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
            {
                                                               printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
            }
                                                         }




    New                    10
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
            {
                                                               printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
            }
                                                         }

start = NULL

    New                    10
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
            {
                                                               printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
            }
                                                         }

start = NULL

    New                    10
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
            {
                                                               printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
            }
                                                         }

                                             c=0+1
    New,
                           10        
    start
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
            {
                                                               printf("Data Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("n Invalid Position...n");
                        c++;
            }
                                                         }

                                             c=0+1
    New,
                           10        
    start
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);             2                              for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
            {
                                                               printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
            }
                                                         }




    start                 10            New
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);            20                      c++;
      if(pos==1)
                                                               }
            {
                                                               printf("nData Inserted Successfully );
                       New->next=start;
                                                             }
                       start->prev=New;
                                                             else
                       start=New;
                                                             printf("nInvalid Position...n");
                       c++;
            }
                                                         }




    start                  10             New                  20
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
    {
                                                               printf("nData Inserted Successfully );
            New->next=start;
                                                             }
            start->prev=New;
                                                             else
            start=New;
                                                             printf("nInvalid Position...n");
            c++;
    }
                                                         }




    start                  10             New                  20
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
    {
                                                               printf("nData Inserted Successfully );
            New->next=start;
                                                             }
            start->prev=New;
                                                             else
            start=New;
                                                             printf("nInvalid Position...n");
            c++;
    }
                                                         }




    start                  10             New                  20      

                    p
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
    {
                                                               printf("nData Inserted Successfully );
            New->next=start;
                                                             }
            start->prev=New;
                                                             else
            start=New;
                                                             printf("nInvalid Position...n");
            c++;
    }
                                                         }




    start                  10             New                  20      

                    p
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
    {
                                                               printf("nData Inserted Successfully );
            New->next=start;
                                                             }
            start->prev=New;
                                                             else
            start=New;
                                                             printf("nInvalid Position...n");
            c++;
    }
                                                         }

q = NULL

    start                  10             New                  20      

                    p
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
    {
                                                               printf("nData Inserted Successfully );
            New->next=start;
                                                             }
            start->prev=New;
                                                             else
            start=New;
                                                             printf("nInvalid Position...n");
            c++;
    }
                                                         }

q = NULL

    start                  10             New                  20      

                    p
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);                                            for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
    {
                                                               printf("nData Inserted Successfully );
            New->next=start;
                                                             }
            start->prev=New;
                                                             else
            start=New;
                                                             printf("nInvalid Position...n");
            c++;
    }
                                                         }

q = NULL

    start                  10             New                   20      

                    p
void insert()                                                else
{                                                            {
    printf("nEnter the position where to insert...");         p=start;
    scanf("%d",&pos);                                          for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));             p=p->next;
    New->prev=New->next=NULL;                                  q = p->next;
    if(pos<=c+1)                                               New->next=q; New->prev=p;
    {                                                          p->next=New;
      printf("nEnter the data to be inserted...");            q->prev=New;
      scanf("%d",&New->data);                                  c++;
      if(pos==1)
                                                             }
    {
                                                         printf("Data Inserted Successfully );
            New->next=start;
                                                           }
            start->prev=New;
                                                           else
            start=New;
                                                           printf("nInvalid Position...n");
            c++;
    }
                                                         }

q = NULL

    start                   10             New               20     

                    p
void insert()                                                  else
{                                                              {
    printf("nEnter the position where to insert...");           p=start;
    scanf("%d",&pos);             2                              for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));               p=p->next;
    New->prev=New->next=NULL;                                    q = p->next;
    if(pos<=c+1)                                                 New->next=q; New->prev=p;
    {                                                            p->next=New;
      printf("nEnter the data to be inserted...");              q->prev=New;
      scanf("%d",&New->data);                                    c++;
      if(pos==1)
                                                               }
            {
                                                               printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
            }
                                                         }



    start                10                                     20      


                      New                  15
void insert()                                                      else
{                                                                  {
    printf("nEnter the position where to insert...");               p=start;
    scanf("%d",&pos);                                                for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));                   p=p->next;
    New->prev=New->next=NULL;                                        q = p->next;
    if(pos<=c+1)                                                     New->next=q; New->prev=p;
    {                                                                p->next=New;
      printf("nEnter the data to be inserted...");                  q->prev=New;
      scanf("%d",&New->data);                 15                     c++;
      if(pos==1)
                                                                   }
            {
                                                                   printf("nData Inserted Successfully );
                       New->next=start;
                                                                 }
                       start->prev=New;
                                                                 else
                       start=New;
                                                                 printf("nInvalid Position...n");
                       c++;
            }
                                                             }



    start                 10                                        20      


                       New                   15
void insert()                                                      else
{                                                                  {
    printf("nEnter the position where to insert...");               p=start;
    scanf("%d",&pos);                                                for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));                   p=p->next;
    New->prev=New->next=NULL;                                        q = p->next;
    if(pos<=c+1)                                                     New->next=q; New->prev=p;
    {                                                                p->next=New;
      printf("nEnter the data to be inserted...");                  q->prev=New;
      scanf("%d",&New->data);                                        c++;
      if(pos==1)
                                                                   }
            {
                                                                   printf("nData Inserted Successfully );
                        New->next=start;
                                                                 }
                        start->prev=New;
                                                                 else
                        start=New;
                                                                 printf("nInvalid Position...n");
                        c++;
            }
                                                             }



    start                 10                                        20      


                       New                   15
void insert()                                                      else
{                                                                  {
    printf("nEnter the position where to insert...");               p=start;
    scanf("%d",&pos);                                                for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));                   p=p->next;
    New->prev=New->next=NULL;                                        q = p->next;
    if(pos<=c+1)                                                     New->next=q; New->prev=p;
    {                                                                p->next=New;
      printf("nEnter the data to be inserted...");                  q->prev=New;
      scanf("%d",&New->data);                                        c++;
      if(pos==1)
                                                                   }
            {
                                                                   printf("nData Inserted Successfully );
                        New->next=start;
                                                                 }
                        start->prev=New;
                                                                 else
                        start=New;
                                                                 printf("nInvalid Position...n");
                        c++;
            }
                                                             }



    start                 10                                        20      

            P
                       New                   15
void insert()                                                      else
{                                                                  {
    printf("nEnter the position where to insert...");               p=start;
    scanf("%d",&pos);                                                for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));                   p=p->next;
    New->prev=New->next=NULL;                                        q = p->next;
    if(pos<=c+1)                                                     New->next=q; New->prev=p;
    {                                                                p->next=New;
      printf("nEnter the data to be inserted...");                  q->prev=New;
      scanf("%d",&New->data);                                        c++;
      if(pos==1)
                                                                   }
            {
                                                                   printf("nData Inserted Successfully );
                        New->next=start;
                                                                 }
                        start->prev=New;
                                                                 else
                        start=New;
                                                                 printf("nInvalid Position...n");
                        c++;
            }
                                                             }



    start                 10                                        20      

            P
                       New                   15
void insert()
                                                                    else
{
                                                                    {
    printf("nEnter the position where to insert...");
                                                                        p=start;
    scanf("%d",&pos);
                                                                        for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));
                                                                         p=p->next;
    New->prev=New->next=NULL;
                                                                        q = p->next;
    if(pos<=c+1)
                                                                        New->next=q; New->prev=p;
    {
                                                                        p->next=New;
      printf("nEnter the data to be inserted...");
                                                                        q->prev=New;
      scanf("%d",&New->data);
                                                                        c++;
      if(pos==1)
                                                                    }
            {
                                                                    printf("nData Inserted Successfully );
                        New->next=start;
                                                                 }
                        start->prev=New;
                                                                 else
                        start=New;
                                                                 printf("nInvalid Position...n");
                        c++;
                                                             }
            }



    start                 10                                            20     

            p                                                                            q
                       New                   15
void insert()
                                                                else
{
                                                                {
    printf("nEnter the position where to insert...");
                                                                    p=start;
    scanf("%d",&pos);
                                                                    for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));
                                                                     p=p->next;
    New->prev=New->next=NULL;
                                                                    q = p->next;
    if(pos<=c+1)
                                                                    New->next=q; New->prev=p;
    {
                                                                    p->next=New;
      printf("nEnter the data to be inserted...");
                                                                    q->prev=New;
      scanf("%d",&New->data);
                                                                    c++;
      if(pos==1)
                                                                }
            {
                                                                printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
                                                         }
            }



    start                 10                                        20     

            p                                                                        q
                       New                   15
void insert()
                                                                else
{
                                                                {
    printf("nEnter the position where to insert...");
                                                                    p=start;
    scanf("%d",&pos);
                                                                    for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));
                                                                     p=p->next;
    New->prev=New->next=NULL;
                                                                    q = p->next;
    if(pos<=c+1)
                                                                    New->next=q; New->prev=p;
    {
                                                                    p->next=New;
      printf("nEnter the data to be inserted...");
                                                                    q->prev=New;
      scanf("%d",&New->data);
                                                                    c++;
      if(pos==1)
                                                                }
            {
                                                                printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
                                                         }
            }



    start                  10                                       20     

            p                                                                        q
                       New                     15
void insert()
                                                                else
{
                                                                {
    printf("nEnter the position where to insert...");
                                                                    p=start;
    scanf("%d",&pos);
                                                                    for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));
                                                                     p=p->next;
    New->prev=New->next=NULL;
                                                                    q = p->next;
    if(pos<=c+1)
                                                                    New->next=q; New->prev=p;
    {
                                                                    p->next=New;
      printf("nEnter the data to be inserted...");
                                                                    q->prev=New;
      scanf("%d",&New->data);
                                                                    c++;
      if(pos==1)
                                                                }
            {
                                                                printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
                                                         }
            }



    start                  10                                       20     

            p                                                                        q
                       New                     15
void insert()
                                                                else
{
                                                                {
    printf("nEnter the position where to insert...");
                                                                    p=start;
    scanf("%d",&pos);
                                                                    for(i=1;i<pos-1;i++)
    New=(struct node *)malloc(sizeof(struct node));
                                                                     p=p->next;
    New->prev=New->next=NULL;
                                                                    q = p->next;
    if(pos<=c+1)
                                                                    New->next=q; New->prev=p;
    {
                                                                    p->next=New;
      printf("nEnter the data to be inserted...");
                                                                    q->prev=New;
      scanf("%d",&New->data);
                                                                    c++;
      if(pos==1)
                                                                }
            {
                                                                printf("nData Inserted Successfully );
                        New->next=start;
                                                             }
                        start->prev=New;
                                                             else
                        start=New;
                                                             printf("nInvalid Position...n");
                        c++;
                                                         }
            }



    start                  10                                       20     

            p                                                                        q
                       New                     15
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);                                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                  10                       15                          20
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);              15                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                10                         15                          20
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);                                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                  10                       15                          20      


                    p
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);                                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                  10                       15                          20      


                    p
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                         }
    }


    start                  10                           15                          20      


                                                     p
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                         }
    }


    start                  10                           15                          20      


                                                     p
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                         }
    }


    start                  10                           15                          20      


                                                     p
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                         }
    }


    start                  10                           15                          20      


                                                     p
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                         }
    }


    start                  10                           15                          20      


                                                     p                       q
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                         }
    }


    start                  10                           15                          20      


                    r                                p                       q
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                         }
    }


    start                  10                           15                          20      


                    r                                p                       q
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                         }
    }


    start                  10                           15                          20      


                    r                                p                       q
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);                                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                  10                       20
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);              10                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                10                         20
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);                                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                  10                       20    


                    p
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);                                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                  10                       20    


                    p
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);                                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                  10                       20    


                    p
void del()                                                if(p->prev==NULL)
{                                                         {
    if(start==NULL)                                               start=start->next;
    {                                                             start->prev=NULL;
            printf("nList is Empty...n");               }
            return;                                       else
    }                                                     {
    printf("nEnter the Data to be Deleted...n");                q = p->next;
    scanf("%d",&item);                                            r = p->prev;
    p=start;                                                      r->next = q;
    while(p!=NULL&&p->data!=item)                                 q->prev = r;
    p=p->next;                                            }
    if(p==NULL)                                           c--;
    {                                                     printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");           free(p);
            return;
                                                     }
    }


    start                  10                       20    


                    p
void del()                                                   if(p->prev==NULL)
{                                                            {
    if(start==NULL)                                                  start=start->next;
    {                                                                start->prev=NULL;
            printf("nList is Empty...n");                  }
            return;                                          else
    }                                                        {
    printf("nEnter the Data to be Deleted...n");                   q = p->next;
    scanf("%d",&item);                                               r = p->prev;
    p=start;                                                         r->next = q;
    while(p!=NULL&&p->data!=item)                                    q->prev = r;
    p=p->next;                                               }
    if(p==NULL)                                              c--;
    {                                                        printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");              free(p);
            return;
                                                        }
    }


                           10                          20    

                    p                           start
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                          }
    }


                           10                          20    

                    p                           start
void del()                                                    if(p->prev==NULL)
{                                                             {
    if(start==NULL)                                                   start=start->next;
    {                                                                 start->prev=NULL;
            printf("nList is Empty...n");                   }
            return;                                           else
    }                                                         {
    printf("nEnter the Data to be Deleted...n");                    q = p->next;
    scanf("%d",&item);                                                r = p->prev;
    p=start;                                                          r->next = q;
    while(p!=NULL&&p->data!=item)                                     q->prev = r;
    p=p->next;                                                }
    if(p==NULL)                                               c--;
    {                                                         printf("%d is Deleted...n",p->data);
            printf("nData is not found...n");               free(p);
            return;
                                                          }
    }


                                                        20    

                                                start
void search()                                   while(p!=NULL)
{                                               {
   if(start==NULL)                                   if(item==p->data)
   {                                                 {
         printf("nList is Empty...n");               printf("Data is Found...n");
         return;                                               break;
   }                                                 }
   printf("nEnter the Item to be                    p=p->next;
   Searched...");                               }
   scanf("%d",&item);                           if(p==NULL)
   p=start;                                     printf("nData is not Found...n");
                                           }


   start            10                    15                    20
void search()                                   while(p!=NULL)
{                                               {
   if(start==NULL)                                   if(item==p->data)
   {                                                 {
         printf("nList is Empty...n");               printf("Data is Found...n");
         return;                                               break;
   }                                                 }
   printf("nEnter the Item to be                    p=p->next;
   Searched...");                               }
   scanf("%d",&item);              15           if(p==NULL)
   p=start;                                     printf("nData is not Found...n");
                                           }


   start            10                    15                    20
void search()                                   while(p!=NULL)
{                                               {
   if(start==NULL)                                   if(item==p->data)
   {                                                 {
         printf("nList is Empty...n");               printf("Data is Found...n");
         return;                                               break;
   }                                                 }
   printf("nEnter the Item to be                    p=p->next;
   Searched...");                               }
   scanf("%d",&item);                           if(p==NULL)
   p=start;                                     printf("nData is not Found...n");
                                           }


   start            10                    15                    20    


                     p
void search()                                   while(p!=NULL)
{                                               {
   if(start==NULL)                                   if(item==p->data)
   {                                                 {
         printf("nList is Empty...n");               printf("Data is Found...n");
         return;                                               break;
   }                                                 }
   printf("nEnter the Item to be                    p=p->next;
   Searched...");                               }
   scanf("%d",&item);                           if(p==NULL)
   p=start;                                     printf("nData is not Found...n");
                                           }


   start            10                    15                    20    


                     p
void search()                                   while(p!=NULL)
{                                               {
   if(start==NULL)                                   if(item==p->data)
   {                                                 {
         printf("nList is Empty...n");               printf("Data is Found...n");
         return;                                               break;
   }                                                 }
   printf("nEnter the Item to be                    p=p->next;
   Searched...");                               }
   scanf("%d",&item);                           if(p==NULL)
   p=start;                                     printf("nData is not Found...n");
                                           }


   start            10                    15                    20    


                     p
void search()                                   while(p!=NULL)
{                                               {
   if(start==NULL)                                   if(item==p->data)
   {                                                 {
         printf("nList is Empty...n");               printf("Data is Found...n");
         return;                                               break;
   }                                                 }
   printf("nEnter the Item to be                    p=p->next;
   Searched...");                               }
   scanf("%d",&item);                           if(p==NULL)
   p=start;                                     printf("nData is not Found...n");
                                           }


   start            10                    15                    20    

                                           p
void search()                                   while(p!=NULL)
{                                               {
   if(start==NULL)                                   if(item==p->data)
   {                                                 {
         printf("nList is Empty...n");               printf("Data is Found...n");
         return;                                               break;
   }                                                 }
   printf("nEnter the Item to be                    p=p->next;
   Searched...");                               }
   scanf("%d",&item);                           if(p==NULL)
   p=start;                                     printf("nData is not Found...n");
                                           }


   start            10                    15                    20    

                                           p
void search()                                   while(p!=NULL)
{                                               {
   if(start==NULL)                                   if(item==p->data)
   {                                                 {
         printf("nList is Empty...n");               printf("Data is Found...n");
         return;                                               break;
   }                                                 }
   printf("nEnter the Item to be                    p=p->next;
   Searched...");                               }
   scanf("%d",&item);                           if(p==NULL)
   p=start;                                     printf("nData is not Found...n");
                                           }


   start            10                    15                    20    

                                           p
void search()                                   while(p!=NULL)
{                                               {
   if(start==NULL)                                   if(item==p->data)
   {                                                 {
         printf("nList is Empty...n");              printf("Data is Found.n");
         return;                                             break;
   }                                                 }
   printf("nEnter the Item to be                    p=p->next;
   Searched...");                               }
   scanf("%d",&item);                           if(p==NULL)
   p=start;                                     printf("nData is not Found...n");
                                           }


   start            10                    15                   20    

                                           p

Mais conteúdo relacionado

Mais procurados (20)

Cquestions
Cquestions Cquestions
Cquestions
 
Data Structures Practical File
Data Structures Practical File Data Structures Practical File
Data Structures Practical File
 
C Prog. - Strings (Updated)
C Prog. - Strings (Updated)C Prog. - Strings (Updated)
C Prog. - Strings (Updated)
 
Avl tree
Avl treeAvl tree
Avl tree
 
week-16x
week-16xweek-16x
week-16x
 
Function basics
Function basicsFunction basics
Function basics
 
C Prog. - Structures
C Prog. - StructuresC Prog. - Structures
C Prog. - Structures
 
C Prog - Strings
C Prog - StringsC Prog - Strings
C Prog - Strings
 
C programms
C programmsC programms
C programms
 
Implementing string
Implementing stringImplementing string
Implementing string
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 
Cpds lab
Cpds labCpds lab
Cpds lab
 
C++ programs
C++ programsC++ programs
C++ programs
 
C Prog - Array
C Prog - ArrayC Prog - Array
C Prog - Array
 
ADA FILE
ADA FILEADA FILE
ADA FILE
 
c-programming-using-pointers
c-programming-using-pointersc-programming-using-pointers
c-programming-using-pointers
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
 
C basics
C basicsC basics
C basics
 
Circular queue
Circular queueCircular queue
Circular queue
 

Destaque

Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureBalwant Gorad
 
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)John C. Havens
 
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)Lovelyn Rose
 
Trees data structure
Trees data structureTrees data structure
Trees data structureSumit Gupta
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked listFahd Allebdi
 
358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8sumitbardhan
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Balwant Gorad
 
6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1smruti sarangi
 
Array implementation and linked list as datat structure
Array implementation and linked list as datat structureArray implementation and linked list as datat structure
Array implementation and linked list as datat structureTushar Aneyrao
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search TreeAbhishek L.R
 
Open Legal Data Workshop at Stanford
Open Legal Data Workshop at StanfordOpen Legal Data Workshop at Stanford
Open Legal Data Workshop at StanfordHarry Surden
 
Harry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law OverviewHarry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law OverviewHarry Surden
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017Carol Smith
 

Destaque (19)

Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
 
Cyber Crime
Cyber CrimeCyber Crime
Cyber Crime
 
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
 
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
 
Trees data structure
Trees data structureTrees data structure
Trees data structure
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked list
 
358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
 
6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
Array implementation and linked list as datat structure
Array implementation and linked list as datat structureArray implementation and linked list as datat structure
Array implementation and linked list as datat structure
 
7 Myths of AI
7 Myths of AI7 Myths of AI
7 Myths of AI
 
Linked list
Linked listLinked list
Linked list
 
linked list
linked list linked list
linked list
 
Linked list
Linked listLinked list
Linked list
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Open Legal Data Workshop at Stanford
Open Legal Data Workshop at StanfordOpen Legal Data Workshop at Stanford
Open Legal Data Workshop at Stanford
 
Harry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law OverviewHarry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law Overview
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
 

Semelhante a Double linked list

Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Treeraviahuja11
 
Polynomial addition
Polynomial additionPolynomial addition
Polynomial additionraviahuja11
 
Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresLakshmi Sarvani Videla
 
Datastructures asignment
Datastructures asignmentDatastructures asignment
Datastructures asignmentsreekanth3dce
 
Singly linked list program in data structure - Vtech
Singly linked list program in data structure - VtechSingly linked list program in data structure - Vtech
Singly linked list program in data structure - VtechVtech Academy of Computers
 
Data structure output 1
Data structure output 1Data structure output 1
Data structure output 1Balaji Thala
 
Write code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docxWrite code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docxnoreendchesterton753
 
Write a program that calculate the no of prime no,even and odd no.
Write a program that calculate the no of prime no,even and odd no.Write a program that calculate the no of prime no,even and odd no.
Write a program that calculate the no of prime no,even and odd no.university of Gujrat, pakistan
 
DATA STRUCTURE USING C & C++
DATA STRUCTURE USING C & C++DATA STRUCTURE USING C & C++
DATA STRUCTURE USING C & C++mustkeem khan
 
DSU C&C++ Practical File Diploma
DSU C&C++ Practical File DiplomaDSU C&C++ Practical File Diploma
DSU C&C++ Practical File Diplomamustkeem khan
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Dr. Loganathan R
 
All important c programby makhan kumbhkar
All important c programby makhan kumbhkarAll important c programby makhan kumbhkar
All important c programby makhan kumbhkarsandeep kumbhkar
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using CBilal Mirza
 

Semelhante a Double linked list (20)

Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Polynomial addition
Polynomial additionPolynomial addition
Polynomial addition
 
Binary tree
Binary treeBinary tree
Binary tree
 
Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structures
 
Os 2 cycle
Os 2 cycleOs 2 cycle
Os 2 cycle
 
Datastructures asignment
Datastructures asignmentDatastructures asignment
Datastructures asignment
 
Ada file
Ada fileAda file
Ada file
 
Singly linked list program in data structure - Vtech
Singly linked list program in data structure - VtechSingly linked list program in data structure - Vtech
Singly linked list program in data structure - Vtech
 
week-17x
week-17xweek-17x
week-17x
 
week-18x
week-18xweek-18x
week-18x
 
Data structure output 1
Data structure output 1Data structure output 1
Data structure output 1
 
Write code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docxWrite code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docx
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
 
Write a program that calculate the no of prime no,even and odd no.
Write a program that calculate the no of prime no,even and odd no.Write a program that calculate the no of prime no,even and odd no.
Write a program that calculate the no of prime no,even and odd no.
 
VTU Data Structures Lab Manual
VTU Data Structures Lab ManualVTU Data Structures Lab Manual
VTU Data Structures Lab Manual
 
DATA STRUCTURE USING C & C++
DATA STRUCTURE USING C & C++DATA STRUCTURE USING C & C++
DATA STRUCTURE USING C & C++
 
DSU C&C++ Practical File Diploma
DSU C&C++ Practical File DiplomaDSU C&C++ Practical File Diploma
DSU C&C++ Practical File Diploma
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
 
All important c programby makhan kumbhkar
All important c programby makhan kumbhkarAll important c programby makhan kumbhkar
All important c programby makhan kumbhkar
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using C
 

Último

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 

Último (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 

Double linked list

  • 1. Double Linked List #include<stdio.h> #include<conio.h> #include<process.h> #include<alloc.h> struct node { int data; struct node *prev,*next; }*start=NULL,*p,*q, *r, *New; int item, pos, c=0, i;
  • 2. Double Linked List void main() { int ch; clrscr(); do { printf("n***MENU***"); printf("n1.Insertn2.Deleten3.Searchn4.Displayn5.Exit"); printf("nPlease Enter the choice..."); scanf("%d",&ch); 1 switch(ch) { case 1:insert();break; case 2:del();break; case 3:search();break; case 4:disp();break; case 5:exit(0); default:printf("nInvalid Choice...n"); } }while(ch!=5); getch(); }
  • 3. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); 1 for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } New
  • 4. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); 10 c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } New 10
  • 5. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } New 10
  • 6. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start = NULL New 10
  • 7. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start = NULL New 10
  • 8. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } c=0+1 New, 10 start
  • 9. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("Data Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("n Invalid Position...n"); c++; } } c=0+1 New, 10 start
  • 10. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); 2 for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 New
  • 11. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); 20 c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 New 20
  • 12. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 New 20
  • 13. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 New 20 p
  • 14. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 New 20 p
  • 15. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } q = NULL start 10 New 20 p
  • 16. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } q = NULL start 10 New 20 p
  • 17. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } q = NULL start 10 New 20 p
  • 18. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("Data Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } q = NULL start 10 New 20 p
  • 19. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); 2 for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 New 15
  • 20. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); 15 c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 New 15
  • 21. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 New 15
  • 22. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 P New 15
  • 23. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 P New 15
  • 24. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 p q New 15
  • 25. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 p q New 15
  • 26. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 p q New 15
  • 27. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 p q New 15
  • 28. void insert() else { { printf("nEnter the position where to insert..."); p=start; scanf("%d",&pos); for(i=1;i<pos-1;i++) New=(struct node *)malloc(sizeof(struct node)); p=p->next; New->prev=New->next=NULL; q = p->next; if(pos<=c+1) New->next=q; New->prev=p; { p->next=New; printf("nEnter the data to be inserted..."); q->prev=New; scanf("%d",&New->data); c++; if(pos==1) } { printf("nData Inserted Successfully ); New->next=start; } start->prev=New; else start=New; printf("nInvalid Position...n"); c++; } } start 10 20 p q New 15
  • 29. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20
  • 30. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); 15 r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20
  • 31. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 p
  • 32. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 p
  • 33. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 p
  • 34. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 p
  • 35. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 p
  • 36. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 p
  • 37. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 p q
  • 38. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 r p q
  • 39. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 r p q
  • 40. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 15 20 r p q
  • 41. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 20
  • 42. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); 10 r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 20
  • 43. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 20 p
  • 44. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 20 p
  • 45. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 20 p
  • 46. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } start 10 20 p
  • 47. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } 10 20 p start
  • 48. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } 10 20 p start
  • 49. void del() if(p->prev==NULL) { { if(start==NULL) start=start->next; { start->prev=NULL; printf("nList is Empty...n"); } return; else } { printf("nEnter the Data to be Deleted...n"); q = p->next; scanf("%d",&item); r = p->prev; p=start; r->next = q; while(p!=NULL&&p->data!=item) q->prev = r; p=p->next; } if(p==NULL) c--; { printf("%d is Deleted...n",p->data); printf("nData is not found...n"); free(p); return; } } 20 start
  • 50. void search() while(p!=NULL) { { if(start==NULL) if(item==p->data) { { printf("nList is Empty...n"); printf("Data is Found...n"); return; break; } } printf("nEnter the Item to be p=p->next; Searched..."); } scanf("%d",&item); if(p==NULL) p=start; printf("nData is not Found...n"); } start 10 15 20
  • 51. void search() while(p!=NULL) { { if(start==NULL) if(item==p->data) { { printf("nList is Empty...n"); printf("Data is Found...n"); return; break; } } printf("nEnter the Item to be p=p->next; Searched..."); } scanf("%d",&item); 15 if(p==NULL) p=start; printf("nData is not Found...n"); } start 10 15 20
  • 52. void search() while(p!=NULL) { { if(start==NULL) if(item==p->data) { { printf("nList is Empty...n"); printf("Data is Found...n"); return; break; } } printf("nEnter the Item to be p=p->next; Searched..."); } scanf("%d",&item); if(p==NULL) p=start; printf("nData is not Found...n"); } start 10 15 20 p
  • 53. void search() while(p!=NULL) { { if(start==NULL) if(item==p->data) { { printf("nList is Empty...n"); printf("Data is Found...n"); return; break; } } printf("nEnter the Item to be p=p->next; Searched..."); } scanf("%d",&item); if(p==NULL) p=start; printf("nData is not Found...n"); } start 10 15 20 p
  • 54. void search() while(p!=NULL) { { if(start==NULL) if(item==p->data) { { printf("nList is Empty...n"); printf("Data is Found...n"); return; break; } } printf("nEnter the Item to be p=p->next; Searched..."); } scanf("%d",&item); if(p==NULL) p=start; printf("nData is not Found...n"); } start 10 15 20 p
  • 55. void search() while(p!=NULL) { { if(start==NULL) if(item==p->data) { { printf("nList is Empty...n"); printf("Data is Found...n"); return; break; } } printf("nEnter the Item to be p=p->next; Searched..."); } scanf("%d",&item); if(p==NULL) p=start; printf("nData is not Found...n"); } start 10 15 20 p
  • 56. void search() while(p!=NULL) { { if(start==NULL) if(item==p->data) { { printf("nList is Empty...n"); printf("Data is Found...n"); return; break; } } printf("nEnter the Item to be p=p->next; Searched..."); } scanf("%d",&item); if(p==NULL) p=start; printf("nData is not Found...n"); } start 10 15 20 p
  • 57. void search() while(p!=NULL) { { if(start==NULL) if(item==p->data) { { printf("nList is Empty...n"); printf("Data is Found...n"); return; break; } } printf("nEnter the Item to be p=p->next; Searched..."); } scanf("%d",&item); if(p==NULL) p=start; printf("nData is not Found...n"); } start 10 15 20 p
  • 58. void search() while(p!=NULL) { { if(start==NULL) if(item==p->data) { { printf("nList is Empty...n"); printf("Data is Found.n"); return; break; } } printf("nEnter the Item to be p=p->next; Searched..."); } scanf("%d",&item); if(p==NULL) p=start; printf("nData is not Found...n"); } start 10 15 20 p