Array, is a data structure consisting of a collection of homogenous datatype or element (values or variables), each identified by at least one array index or key. An array is stored in such a manner that the position of each element can be found out from its index tuple by using a mathematical formula. The simplest data structure is a linear array, also known as one-dimensional array.
Arrays are among the most important data structures, and are used in almost every program. They can be also used to implement many other data structures, such as linked-lists and stacks. The most important fact is that arrays are linear datatypes in which data is stored in sequence. In many internal and external storage devices, the memory is a one-dimensional array of words, whose indices are their addresses. We can access the elements if we know their indexes directly so, we can say that random access is possible in array.
In the above algorithm,