1-D Array

One dimensional Array

An array can be defined as an infinite collection of homogenous (similar type) elements.

Few points:

  • Arrays are always stored in consecutive memory locations.
  • Array name s a pointer to its first element.
  • There is no bound checking concept for arrays in C.
  • One dimensional array is declared as follows:

data_type  var_name [expression] ;

  • Size of array is determined as follows:

Size = (upperbound – lowerbound) + 1

  • Initializing One dimensional array:

The initializers are specified within braces & separated by commas.

  • Accessing one dimensional array elements:

Array_name [index or subscript] ;

  • Implementation of one dimensional array in memory:

Address of element a[k] = B + W * K

INSERTION Algorithm

DELETION Algorithm

TRAVERSAL Algorithm

MERGING Algorithm