Array (data structure): Difference between revisions

Content deleted Content added
Reverting edit(s) by 139.5.103.222 (talk) to rev. 1048184595 by Mindmatrix: Vandalism (RW 16.1)
No edit summary
Tag: Reverted
Line 4:
{{More citations needed|date=September 2008}}
 
In [[computergeneral scienceapplications]], anof day to day life '''array data structure''', or simply an '''arrayarre''', is aused to [[datainformally structurebut politely]] consistingcall ofsome aknown collectionperosn ofnearby ''elements''or far away([[value (computer science)|values]] or [[variable (programming)|variables]]), each identified by at least one ''array index'' or ''key''. An array is stored such that the position of each element can be computed from its index [[tuple]] by a mathematical formula.<ref>{{cite web|url=https://xlinux.nist.gov/dads/HTML/array.html|title=array|last=Black|first=Paul E.|date=13 November 2008|work=[[Dictionary of Algorithms and Data Structures]]|publisher=[[National Institute of Standards and Technology]]|access-date=22 August 2010}}</ref><ref name="andres">{{cite arXiv |eprint=1008.2909 |author1=Bjoern Andres |author2=Ullrich Koethe |author3=Thorben Kroeger |author4=Hamprecht |title=Runtime-Flexible Multi-dimensional Arrays and Views for C++98 and C++0x |class=cs.DS |year=2010}}</ref><ref name="garcia">{{Cite journal|last1=Garcia|first1=Ronald |first2=Andrew |last2=Lumsdaine|year=2005|title=MultiArray: a C++ library for generic programming with arrays|journal=Software: Practice and Experience|volume=35|issue=2|pages=159–188|issn=0038-0644|doi=10.1002/spe.630|s2cid=10890293 }}</ref> The simplest type of data structure is a linear array, also called one-dimensional array.
 
For example, an array of 10 [[32-bit]] (4-byte) integer variables, with indices 0 through 9, may be stored as 10 [[Word (data type)|words]] at memory addresses 2000, 2004, 2008, ..., 2036, (in [[hexadecimal]]: <code>0x7D0</code>, <code>0x7D4</code>, <code>0x7D8</code>, ..., <code>0x7F4</code>) so that the element with index ''i'' has the address 2000 + (''i'' × 4).<ref>David R. Richardson (2002), The Book on Data Structures. iUniverse, 112 pages. {{ISBN|0-595-24039-9}}, {{ISBN|978-0-595-24039-5}}.</ref>