What is Linear Array and Memory Allocation

Errorlogger
0
Linear Array:- Array is a set of homogeneous data type that have a common name the array has fix number of element. There are some features of array.
  1. The element of the array are access with the help of index number.
  2. These index number will be consecutive integer number.
  3. The elements of the array are stored in successive memory location. If array has N element then the size of the array will also be N.

Memory Allocation 

LB in the array specify the Lower Bound. It contain the index number of array first element. UB specify the Upper Bound of the array. It contain the index number of array last element. If we no the Lower Bound as well as Upper Bound then we can calculate the size of array (size of array, length of array)

Size = UB - LB + 1

Array is also known as subscript variable because we specify the index of each element while accessing the value. The array in the memory save in the consecutive memory location. The Advantage of this feature that we can calculate the address of any array element. To calculate the address of array element we must know the base address (Address of array first element). An word size (Number of memory cell require to save the one value)

LA[K] = Base [LA] + W[K - LB]

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(30)

Our website uses cookies to enhance your experience. Check Now
Accept !