Page 86 - DCAP201_FUNDAMENTALS_OF_DATA_STRUCTURES
P. 86

Unit 6: Operations on Arrays and Sparse Matrices




                                ptrb++;                                                         Notes
                          }
                   else
                          {
                           c[ptrc]=a[ptra];
                           ptra++;
                          }
                  ptrc++;
                  }
            while(ptra<k)
                  {
                           c[ptrc]=a[ptra];
                           ptra++;ptrc++;
                          }
            while(ptrb<k)
                  {
                           c[ptrc]=b[ptrb];
                           ptrb++; ptrc++;


                          }
           }


          The output is shown as below:
































              Task  Write a program that creates an array consisting of elements 3,4, 5, 6 and 7; removes
            4 from the array; and inserts 11 after 7 in the array.




                                           LOVELY PROFESSIONAL UNIVERSITY                                   79
   81   82   83   84   85   86   87   88   89   90   91