Content deleted Content added
URLs are broken. Tags: Mobile edit Mobile web edit |
Citation bot (talk | contribs) Misc citation tidying. | Use this bot. Report bugs. | #UCB_CommandLine |
||
Line 13:
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 [[list (computing)|list]]s and [[string (computer science)|string]]s. They effectively exploit the addressing logic of computers. In most modern computers and many [[external storage]] devices, the memory is a one-dimensional array of words, whose indices are their addresses. [[Central processing unit|Processors]], especially [[vector processor]]s, are often optimized for array operations.
Arrays are useful mostly because the element indices can be computed at [[Run time (program lifecycle phase)|run time]]. Among other things, this feature allows a single iterative [[statement (programming)|statement]] to process arbitrarily many elements of an array. For that reason, the elements of an array data structure are required to have the same size and should use the same data representation. The set of valid index tuples and the addresses of the elements (and hence the element addressing formula) are usually,<ref name="garcia" /><ref name="veldhuizen">{{cite conference |first1=Todd L. |last1=Veldhuizen |title=Arrays in Blitz++ |publisher=Springer |___location=Berlin |conference=Computing in Object-Oriented Parallel Environments |date=December 1998 |isbn=978-3-540-65387-5 |pages=223–230 |series=Lecture Notes in Computer Science |volume=1505 |doi=10.1007/3-540-49372-7_24 }}{{dead link|
The term "array" may also refer to an [[array data type]], a kind of [[data type]] provided by most [[high-level programming language]]s 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; however, in some languages they may be implemented by [[hash table]]s, [[linked list]]s, [[search tree]]s, or other data structures.
|