Sunday, October 11, 2009

Difference of Record and Linear Arrays

a) A record may be a collection of non-homogenous data i.e; the data items in a record may have different data types. In case of arrays, data elements are homogenous.

b) The data items in a record are indexed by attribute names, so there may not be a natural ordering of its elements. In arrays, data items are in natural order as they are sequenced by indices.

Uses of Record Structure :

1. Records are useful for modeling objects that have a number of characteristics. The record data type allows to collect various types of data about an object and to refer to the whole object by a single name. Different attributes or fields are also referred by name.

2. Records are also useful for defining other data structures, allowing programmers to combine information describing characteristics of the structure with the storage of the elements.

Note: Data files comprising of records and fields as hierarchical components are usually organized on randomized or hashed tables. These tables are implemented in arrays. In this sense, every data element of an array is a record defined as C/C++ structure.

No comments:

Post a Comment