One Dimensional Array

  • Simplest data structure that makes use of computed address to locate its elements is the one-dimensional array or vector;number of memory locations is sequentially allocated to the vector.
  • A vector size is fixed and therefore requires a fixed number of memory locations.
  • Vector A with subscript lower bound of “one” is represented as below
  1. L0is the address of the first word allocated to the first element of vector A.
  2. C words are allocated for each element or node
  3. The address of Ai is given equation Loc (Ai) = L0+ C (i-1)
  4. Let’s consider the more general case of representing a vector A whose lower bound for it’s subscript is given by some variable b. The location of Ai is then given by Loc (Ai) = L0+ C (i-b)

one dimens

For any query or issue, feel free to discuss on