Page 63 - DCAP407_DATA_STRUCTURE
P. 63

Data Structure



                          3.5   Keywords

                          Average  Case  Performance:  Average case of a given algorithm denotes the average  usage of the
                          resources. Usually the resource considered is  run time, but it could also be memory  or any other
                          resources.
                          Composite Structures: Data structures made of distinguishable data types.

                          Index: A non-negative integer used to identify an array element.

                          Worst Case Performance: Worst case of a given algorithm denotes the maximum usage of resources.
                          Usually the resource considered is run time, but it could also be memory or any other resources.

                          3.6   Self Assessment
                          1.  State whether the following statements are true or false:
                              (a)  The data stored in the memory can be manipulated with the help of data structures.
                              (b)  An array is initialized by assigning values to the elements.
                              (c)  When an array is referred by multiple subscripts then it is called a linear array.

                              (d)  Linear arrays cannot be indexed.
                              (e)  An array can be initialized at the time of its declaration.
                              (f)   Programming languages need to store and manipulate two or more dimensional data
                                   structure such as matrices.
                          2.  Fill in the blanks:

                              (a)  ……………………… condition occurs if you try to insert the data to an array when there is no
                                  space available for insertion.
                              (b)  Any sequence with repeated objects or shapes forms a ………………………
                              (c)  A ………………… character terminates every string.
                              (d)  ……………… sort is the simplest of all sorting algorithms.

                              (e)  …………………… operation involves printing each element in an array.
                          3.  Select a suitable choice for every question:
                              (a)  Which of the following operations arranges the elements of a list in a certain order?
                                  (i)   Traversing
                                  (ii)   Declaration
                                 (iii)   Initialization

                                 (iv)   Sorting
                              (b)  Which among the following  algorithms have an average  and worst case performance of
                                  O(n2)?
                                  (i)   Bubble sort
                                  (ii)   Merge sort

                                 (iii)   Heap sort
                                 (iv)   Quick sort









                          56                      LOVELY PROFESSIONAL UNIVERSITY
   58   59   60   61   62   63   64   65   66   67   68