Difference between revisions of "Array"

From Conservapedia
Jump to navigation Jump to search
(add category)
m (Added link)
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
 
array[ n ]
 
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
+
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 ]
 
array[ x ][ y ][ z ]
Line 19: Line 19:
  
 
[[Category:Computers]]
 
[[Category:Computers]]
[[Category:Data structures]]
+
[[Category:Data Structures]]

Latest revision as of 21:50, March 24, 2021

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