Linear Arrays
A linear array is a list of a finite number ‘n’ of homogeneous data elements (i.e. data elements of same type) such that:
- The elements of the arrays are referenced respectively by an index set consisting of ‘n’ consecutive numbers.
- The elements of the array are stored respectively in successive memory location.
- The length or the number of data element of the array can be obtained from the index set by the formula:
Length = UB – LB + 1
Where upper bound (UB) is the largest index, and LB is the smallest index, called the lower bound, of the array.
Note that length = UB when LB = 1.
Post a Comment