Page 95 - DCAP201_FUNDAMENTALS_OF_DATA_STRUCTURES
P. 95

Fundamentals of Data Structures




                    Notes          Self Assessment

                                   Fill in the blanks:
                                   3.  Matrices with good number of zero entries are called ....................................
                                   4.  A ....................... is a square matrix in which all the elements either above or below the
                                       main diagonal are zero.
                                   5.  A ....................... matrix is a square matrix in which all the elements except for the main
                                       diagonal, diagonals on the immediate upper and lower side are zeroes.

                                   6.  The ....................... format puts the subsequent non-zeros of the matrix rows in contiguous
                                       memory locations.
                                   7.  The compressed column storage (CCS) is also known as the ....................... sparse matrix
                                       format.
                                   8.  ....................... matrices typically arise from the discretisation of partial differential equations
                                       in which there are several degrees of freedom associated with a grid point.
                                   9.  The ....................... format can be useful for the implementation of iterative methods on
                                       parallel and vector processors.
                                   10.  ....................... storage is considered as a simplified form of JDS.
                                   11.  The number of jagged diagonals is equal to the number of ....................... in the first row.
                                   12.  ....................... matrices is mostly of importance in direct solution methods.
                                   13.  The CCS format is identical to the CRS format except that the ....................... are stored
                                       (traversed) instead of the rows.
                                   14.  Like the CDS format, JD format gives a ....................... length of essentially the same size as
                                       the matrix.
                                   15.  A common way of representing non-zero elements of a sparse matrix is the .......................
                                       form.



                                     Case Study  Deleting Duplicate Elements in an Array


                                     Write a C Program to delete duplicate elements in an array.
                                     #include<stdio.h>
                                     #include<conio.h>
                                     main()
                                     {
                                     int a[20],i,j,k,n;
                                     clrscr();
                                     printf("nEnter array size : ");
                                     scanf("%d",&n);
                                     printf("nAccept Numbers : ",n);
                                     for(i=0;i<n;i++)
                                                                                                         Contd...



          88                                LOVELY PROFESSIONAL UNIVERSITY
   90   91   92   93   94   95   96   97   98   99   100