Page 79 - DCAP407_DATA_STRUCTURE
P. 79

Data Structure



                                                  2 Gender
                                                  2 Birthday                             //group item
                                                      3 Month                            // sub item
                                                      3 Day
                                                      3 Year
                                                  2 Father
                                                      3 Name
                                                      3 Age
                                                  2 Mother
                                                      3 Name
                                                      3 Age
                                                  2 Address
                                                      3 Dno
                                                      3 Road
                                                      3 Area

                                          The number to the left of each identifier is known as level number. Each group
                                          item is followed by its sub items. The level of sub items is 1 more than the level of
                                          the group item.
                          In a record structure, some of the identifiers may also be referred to as arrays of elements. In the above
                          example, suppose the first line of the structure is replaced by
                          1 Application (20)
                          This indicates that there is a file of 20 records, and the different records in the file can be distinguished
                          by using the usual subscript notation.

                          That is, we will write
                          Application 1  , Application 2, Application 3
                          Or
                          Application [1], Application [2], Application [3]
                          to denote the different records in the file.
                          4.6.1   Indexing Items in a Record

                          Suppose, we want to access few data items in a record, then we cannot simply write the data name of
                          the item. This is because the name might appear in different places in the record.

                                           The structure of the kindergarten application record is as follows:
                                           1 Application
                                                   2 Name
                                                   2 Gender
                                                   2 Birthday
                                                       3 Month
                                                       3 Day
                                                       3 Year
                                                   2 Father
                                                       3 Name
                                                       3 Age
                                                   2 Mother
                                                       3 Name
                                                       3 Age
                                                   2 Address
                                                       3 Dno
                                                       3 Road
                                                       3 Area



                          72                      LOVELY PROFESSIONAL UNIVERSITY
   74   75   76   77   78   79   80   81   82   83   84