Difference between revisions of "Array"

From Conservapedia
Jump to navigation Jump to search
(New page: In computer science, an '''array''' is a data structure which consists of a collection of homogenous data accessed via an '''index'''. The index is usually a scalar value, such as an ...)
 
(add category)
Line 19: Line 19:
  
 
[[Category:Computers]]
 
[[Category:Computers]]
 +
[[Category:Data structures]]

Revision as of 03:40, June 20, 2008

In computer science, an array is a data structure which consists of a collection of homogenous data accessed via an index. The index is usually a scalar value, such as an integer. The index specifies one of the elements, or values, within the array. For instance, in the C++ programming language, the nth element of an array named array would be accessed via the following source code:

array[ n ]

Arrays may be single-dimensional, or mutli-dimensional (aka poly-dimensional). A 2-dimensional array with data consisting of numbers can be thought of as a form of mathematical Matrix. Although implementations vary, a multi-dimensional array can be conceptualized as an array of other arrays. For instance, a 3-dimensional array could be accessed as

array[ x ][ y ][ z ]

or (in a short-hand version) as

array[ x, y, z ]


Array may also refer to a collection of hardware components, such as a Disk array, or as a synonym to vector.

References