Array (data structure): Difference between revisions

Content deleted Content added
Wikibot (talk | contribs)
m robot interwiki standardization
Sewing (talk | contribs)
mNo edit summary
Line 17:
One of the disadvantages of an array is that it has a single fixed size, and although its size can be altered in many environments, this is an expensive operation. <i>Growable arrays</i> or <i>dynamic arrays</i> are arrays which automatically perform this resizing as late as possible, when the programmer attempts to add an element to the end of the array and there is no more space. To average the high cost of resizing over a long period of time (we say it is an [[amortized analysis|amortized cost]]), they expand by a large amount, and when the programmer attempts to expand the array again, it just uses more of this reserved space.
 
In the [[C programming language]], one-dimensional [[character (computing)|character]] arrays are used to store null-terminated [[string]]s, so called because the end of the string is indicated with a special reserved character called a [[null character]] ('\0') (see also [[C string]]).
 
=== Representations of Multi-dimensional Arrays ===