Page 44 - DCAP407_DATA_STRUCTURE
P. 44

Mandeep Kaur, Lovely Professional University                          Unit 3: Arrays



                                              Unit 3: Arrays


               CONTENTS
               Objectives
               Introduction
               3.1 Fundamentals of Arrays
               3.2 Types of Arrays

                     3.2.1   Linear Array
                     3.2.2   Multidimensional Array
               3.3 Types of Array Operations
                     3.3.1   Adding Operation
                     3.3.2   Sorting Operation
                    3.3.3   Searching Operation
                     3.3.4   Traversing Operation

               3.4 Summary
               3.5 Keywords
               3.6 Self Assessment
               3.7 Review Questions
               3.8 Further Readings

               Objectives
               After studying this unit, you will be able to:
               •    Recall the fundamentals of arrays
               •    Explain the types of arrays

               •    Describe the types of array operations
               Introduction
               A data structure consists of a group of data elements bound by the same set of rules. The data elements
               also known  as members are  of different types and lengths. We can manipulate data stored in the
               memory with the help of data structures. The study of data structures involves examining the merging
               of simple structures to form composite structures and accessing definite components from composite
               structures. An array is an example of one such composite data structure that is derived from a primitive
               data structure.



               Did you know?   APL (named after the book A Programming Language), designed by Ken Iverson, was
                             the first programming language to provide array programming capabilities.
               An array is  a set of similar data elements grouped together.  Arrays can be one-dimensional or
               multidimensional. Arrays store the entries sequentially. Elements in an array are stored in continuous
               locations and are identified using the location of the first element of the array.
               3.1   Fundamentals of Arrays

               An array is a data type, much like a variable as both array and variable hold information. However,
               unlike a variable, an array can hold several pieces of data called elements. Arrays can hold any type of




                                        LOVELY PROFESSIONAL UNIVERSITY                           37
   39   40   41   42   43   44   45   46   47   48   49