what is array

11 months ago 15
Nature

An array is a data structure consisting of a collection of elements of the same data type, each identified by at least one array index or key). The elements of an array are stored in contiguous memory locations, and each element can be uniquely identified by its index in the array. Arrays are among the oldest and most important data structures, and are used by almost every program). They are also used to implement many other data structures, such as lists and strings). Arrays effectively exploit the addressing logic of computers, and in most modern computers and many external storage devices, the memory is a one-dimensional array of words, whose indices are their addresses).

The term "array" may also refer to an array data type, a kind of data type provided by most high-level programming languages that consists of a collection of values or variables that can be selected by one or more indices computed at run-time). Array types are often implemented by array structures).

Arrays are useful for solving high-level problems like the "longest consecutive subsequence" program or some easy tasks like arranging the same things in ascending order. They are also used in situations where a collection of similar data elements need to be stored in contiguous memory locations.