<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
an	O
array	O
is	O
a	O
data	B-General_Concept
structure	I-General_Concept
consisting	O
of	O
a	O
collection	O
of	O
elements	O
(	O
values	O
or	O
variables	O
)	O
,	O
of	O
same	O
memory	O
size	O
,	O
each	O
identified	O
by	O
at	O
least	O
one	O
array	O
index	O
or	O
key	O
.	O
</s>
<s>
An	O
array	O
is	O
stored	O
such	O
that	O
the	O
position	O
of	O
each	O
element	O
can	O
be	O
computed	O
from	O
its	O
index	O
tuple	B-Application
by	O
a	O
mathematical	O
formula	O
.	O
</s>
<s>
The	O
simplest	O
type	O
of	O
data	B-General_Concept
structure	I-General_Concept
is	O
a	O
linear	O
array	O
,	O
also	O
called	O
one-dimensional	O
array	O
.	O
</s>
<s>
Because	O
the	O
mathematical	O
concept	O
of	O
a	O
matrix	B-Architecture
can	O
be	O
represented	O
as	O
a	O
two-dimensional	O
grid	O
,	O
two-dimensional	O
arrays	O
are	O
also	O
sometimes	O
called	O
"	O
matrices	B-Architecture
"	O
.	O
</s>
<s>
In	O
some	O
cases	O
the	O
term	O
"	O
vector	O
"	O
is	O
used	O
in	O
computing	O
to	O
refer	O
to	O
an	O
array	O
,	O
although	O
tuples	B-Application
rather	O
than	O
vectors	O
are	O
the	O
more	O
mathematically	O
correct	O
equivalent	O
.	O
</s>
<s>
Tables	O
are	O
often	O
implemented	O
in	O
the	O
form	O
of	O
arrays	O
,	O
especially	O
lookup	B-Data_Structure
tables	I-Data_Structure
;	O
the	O
word	O
"	O
table	B-Application
"	O
is	O
sometimes	O
used	O
as	O
a	O
synonym	O
of	O
array	O
.	O
</s>
<s>
Arrays	O
are	O
among	O
the	O
oldest	O
and	O
most	O
important	O
data	B-General_Concept
structures	I-General_Concept
,	O
and	O
are	O
used	O
by	O
almost	O
every	O
program	O
.	O
</s>
<s>
They	O
are	O
also	O
used	O
to	O
implement	O
many	O
other	O
data	B-General_Concept
structures	I-General_Concept
,	O
such	O
as	O
lists	O
and	O
strings	O
.	O
</s>
<s>
In	O
most	O
modern	O
computers	O
and	O
many	O
external	B-Device
storage	I-Device
devices	O
,	O
the	O
memory	O
is	O
a	O
one-dimensional	O
array	O
of	O
words	O
,	O
whose	O
indices	O
are	O
their	O
addresses	O
.	O
</s>
<s>
Processors	B-General_Concept
,	O
especially	O
vector	B-Operating_System
processors	I-Operating_System
,	O
are	O
often	O
optimized	O
for	O
array	O
operations	O
.	O
</s>
<s>
Arrays	O
are	O
useful	O
mostly	O
because	O
the	O
element	O
indices	O
can	O
be	O
computed	O
at	O
run	B-Library
time	I-Library
.	O
</s>
<s>
For	O
that	O
reason	O
,	O
the	O
elements	O
of	O
an	O
array	B-Data_Structure
data	I-Data_Structure
structure	I-Data_Structure
are	O
required	O
to	O
have	O
the	O
same	O
size	O
and	O
should	O
use	O
the	O
same	O
data	O
representation	O
.	O
</s>
<s>
The	O
set	O
of	O
valid	O
index	O
tuples	B-Application
and	O
the	O
addresses	O
of	O
the	O
elements	O
(	O
and	O
hence	O
the	O
element	O
addressing	O
formula	O
)	O
are	O
usually	O
,	O
but	O
not	O
always	O
,	O
fixed	O
while	O
the	O
array	O
is	O
in	O
use	O
.	O
</s>
<s>
The	O
term	O
"	O
array	O
"	O
may	O
also	O
refer	O
to	O
an	O
array	O
data	O
type	O
,	O
a	O
kind	O
of	O
data	O
type	O
provided	O
by	O
most	O
high-level	B-Language
programming	I-Language
languages	I-Language
that	O
consists	O
of	O
a	O
collection	O
of	O
values	O
or	O
variables	O
that	O
can	O
be	O
selected	O
by	O
one	O
or	O
more	O
indices	O
computed	O
at	O
run-time	O
.	O
</s>
<s>
Array	O
types	O
are	O
often	O
implemented	O
by	O
array	O
structures	O
;	O
however	O
,	O
in	O
some	O
languages	O
they	O
may	O
be	O
implemented	O
by	O
hash	B-Algorithm
tables	I-Algorithm
,	O
linked	B-Data_Structure
lists	I-Data_Structure
,	O
search	B-Data_Structure
trees	I-Data_Structure
,	O
or	O
other	O
data	B-General_Concept
structures	I-General_Concept
.	O
</s>
<s>
The	O
term	O
is	O
also	O
used	O
,	O
especially	O
in	O
the	O
description	O
of	O
algorithms	O
,	O
to	O
mean	O
associative	B-Application
array	I-Application
or	O
"	O
abstract	O
array	O
"	O
,	O
a	O
theoretical	O
computer	B-General_Concept
science	I-General_Concept
model	O
(	O
an	O
abstract	O
data	O
type	O
or	O
ADT	O
)	O
intended	O
to	O
capture	O
the	O
essential	O
properties	O
of	O
arrays	O
.	O
</s>
<s>
The	O
first	O
digital	O
computers	O
used	O
machine-language	O
programming	O
to	O
set	O
up	O
and	O
access	O
array	O
structures	O
for	O
data	B-Application
tables	I-Application
,	O
vector	O
and	O
matrix	B-Architecture
computations	O
,	O
and	O
for	O
many	O
other	O
purposes	O
.	O
</s>
<s>
John	O
von	O
Neumann	O
wrote	O
the	O
first	O
array-sorting	O
program	O
(	O
merge	B-Algorithm
sort	I-Algorithm
)	O
in	O
1945	O
,	O
during	O
the	O
building	O
of	O
the	O
first	O
stored-program	O
computer.p.	O
</s>
<s>
159	O
Array	O
indexing	O
was	O
originally	O
done	O
by	O
self-modifying	B-Application
code	I-Application
,	O
and	O
later	O
using	O
index	B-General_Concept
registers	I-General_Concept
and	O
indirect	B-Language
addressing	I-Language
.	O
</s>
<s>
Some	O
mainframes	O
designed	O
in	O
the	O
1960s	O
,	O
such	O
as	O
the	O
Burroughs	B-Device
B5000	I-Device
and	O
its	O
successors	O
,	O
used	O
memory	B-General_Concept
segmentation	I-General_Concept
to	O
perform	O
index-bounds	O
checking	O
in	O
hardware	O
.	O
</s>
<s>
The	O
earliest	O
high-level	B-Language
programming	I-Language
languages	I-Language
,	O
including	O
FORTRAN	B-Application
(	O
1957	O
)	O
,	O
Lisp	B-Language
(	O
1958	O
)	O
,	O
COBOL	B-Application
(	O
1960	O
)	O
,	O
and	O
ALGOL	B-Language
60	I-Language
(	O
1960	O
)	O
,	O
had	O
support	O
for	O
multi-dimensional	O
arrays	O
,	O
and	O
so	O
has	O
C	B-Language
(	O
1972	O
)	O
.	O
</s>
<s>
In	O
C++	B-Language
(	O
1983	O
)	O
,	O
class	O
templates	O
exist	O
for	O
multi-dimensional	O
arrays	O
whose	O
dimension	O
is	O
fixed	O
at	B-Library
runtime	I-Library
as	O
well	O
as	O
for	O
runtime-flexible	O
arrays	O
.	O
</s>
<s>
Arrays	O
are	O
used	O
to	O
implement	O
mathematical	O
vectors	O
and	O
matrices	B-Architecture
,	O
as	O
well	O
as	O
other	O
kinds	O
of	O
rectangular	O
tables	O
.	O
</s>
<s>
Arrays	O
are	O
used	O
to	O
implement	O
other	O
data	B-General_Concept
structures	I-General_Concept
,	O
such	O
as	O
lists	O
,	O
heaps	B-Application
,	O
hash	B-Algorithm
tables	I-Algorithm
,	O
deques	B-Application
,	O
queues	B-Application
,	O
stacks	B-Application
,	O
strings	O
,	O
and	O
VLists	O
.	O
</s>
<s>
Array-based	O
implementations	O
of	O
other	O
data	B-General_Concept
structures	I-General_Concept
are	O
frequently	O
simple	O
and	O
space-efficient	O
(	O
implicit	B-Data_Structure
data	I-Data_Structure
structures	I-Data_Structure
)	O
,	O
requiring	O
little	O
space	O
overhead	O
,	O
but	O
may	O
have	O
poor	O
space	O
complexity	O
,	O
particularly	O
when	O
modified	O
,	O
compared	O
to	O
tree-based	O
data	B-General_Concept
structures	I-General_Concept
(	O
compare	O
a	O
sorted	B-Data_Structure
array	I-Data_Structure
to	O
a	O
search	B-Data_Structure
tree	I-Data_Structure
)	O
.	O
</s>
<s>
One	O
or	O
more	O
large	O
arrays	O
are	O
sometimes	O
used	O
to	O
emulate	O
in-program	O
dynamic	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
,	O
particularly	O
memory	B-General_Concept
pool	I-General_Concept
allocation	O
.	O
</s>
<s>
Historically	O
,	O
this	O
has	O
sometimes	O
been	O
the	O
only	O
way	O
to	O
allocate	O
"	O
dynamic	B-General_Concept
memory	I-General_Concept
"	O
portably	O
.	O
</s>
<s>
They	O
are	O
known	O
in	O
this	O
context	O
as	O
control	B-Application
tables	I-Application
and	O
are	O
used	O
in	O
conjunction	O
with	O
a	O
purpose	O
built	O
interpreter	O
whose	O
control	O
flow	O
is	O
altered	O
according	O
to	O
values	O
contained	O
in	O
the	O
array	O
.	O
</s>
<s>
Usually	O
programming	O
languages	O
allowing	O
n-based	O
indexing	O
also	O
allow	O
negative	O
index	O
values	O
and	O
other	O
scalar	O
data	O
types	O
like	O
enumerations	B-Language
,	O
or	O
characters	O
may	O
be	O
used	O
as	O
an	O
array	O
index	O
.	O
</s>
<s>
Using	O
zero	O
based	O
indexing	O
is	O
the	O
design	O
choice	O
of	O
many	O
influential	O
programming	O
languages	O
,	O
including	O
C	B-Language
,	O
Java	B-Language
and	O
Lisp	B-Language
.	O
</s>
<s>
This	O
leads	O
to	O
simpler	O
implementation	O
where	O
the	O
subscript	O
refers	O
to	O
an	O
offset	B-General_Concept
from	O
the	O
starting	O
position	O
of	O
an	O
array	O
,	O
so	O
the	O
first	O
element	O
has	O
an	O
offset	B-General_Concept
of	O
zero	O
.	O
</s>
<s>
The	O
number	O
of	O
indices	O
needed	O
to	O
specify	O
an	O
element	O
is	O
called	O
the	O
dimension	O
,	O
dimensionality	O
,	O
or	O
rank	B-Data_Structure
of	O
the	O
array	O
.	O
</s>
<s>
In	O
standard	O
arrays	O
,	O
each	O
index	O
is	O
restricted	O
to	O
a	O
certain	O
range	O
of	O
consecutive	O
integers	O
(	O
or	O
consecutive	O
values	O
of	O
some	O
enumerated	B-Language
type	I-Language
)	O
,	O
and	O
the	O
address	O
of	O
an	O
element	O
is	O
computed	O
by	O
a	O
"	O
linear	O
"	O
formula	O
on	O
the	O
indices	O
.	O
</s>
<s>
As	O
an	O
example	O
consider	O
the	O
C	B-Language
declaration	O
int	O
anArrayName[10];	O
which	O
declares	O
a	O
one-dimensional	O
array	O
of	O
ten	O
integers	O
.	O
</s>
<s>
For	O
a	O
vector	O
with	O
linear	O
addressing	O
,	O
the	O
element	O
with	O
index	O
i	O
is	O
located	O
at	O
the	O
address	O
,	O
where	O
B	O
is	O
a	O
fixed	O
base	O
address	O
and	O
c	B-Language
a	O
fixed	O
constant	O
,	O
sometimes	O
called	O
the	O
address	O
increment	O
or	O
stride	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
the	O
C	B-Language
programming	I-Language
language	I-Language
specifies	O
that	O
array	O
indices	O
always	O
begin	O
at	O
0	O
;	O
and	O
many	O
programmers	O
will	O
call	O
that	O
element	O
"	O
zeroth	O
"	O
rather	O
than	O
"	O
first	O
"	O
.	O
</s>
<s>
For	O
a	O
multidimensional	O
array	O
,	O
the	O
element	O
with	O
indices	O
i	O
,	O
j	O
would	O
have	O
address	O
B	O
+	O
c	B-Language
·	O
i	O
+	O
d	O
·	O
j	O
,	O
where	O
the	O
coefficients	O
c	B-Language
and	O
d	O
are	O
the	O
row	O
and	O
column	O
address	O
increments	O
,	O
respectively	O
.	O
</s>
<s>
The	O
coefficients	O
ck	O
must	O
be	O
chosen	O
so	O
that	O
every	O
valid	O
index	O
tuple	B-Application
maps	O
to	O
the	O
address	O
of	O
a	O
distinct	O
element	O
.	O
</s>
<s>
Taking	O
advantage	O
of	O
this	O
feature	O
,	O
some	O
languages	O
(	O
like	O
FORTRAN	B-Application
77	O
)	O
specify	O
that	O
array	O
indices	O
begin	O
at	O
1	O
,	O
as	O
in	O
mathematical	O
tradition	O
while	O
other	O
languages	O
(	O
like	O
Fortran	B-Application
90	O
,	O
Pascal	O
and	O
Algol	B-Language
)	O
let	O
the	O
user	O
choose	O
the	O
minimum	O
value	O
for	O
each	O
index	O
.	O
</s>
<s>
It	O
is	O
often	O
useful	O
to	O
pack	O
these	O
parameters	O
into	O
a	O
record	O
called	O
the	O
array	O
's	O
descriptor	O
or	O
stride	O
vector	O
or	O
dope	B-Data_Structure
vector	I-Data_Structure
.	O
</s>
<s>
The	O
size	O
of	O
each	O
element	O
,	O
and	O
the	O
minimum	O
and	O
maximum	O
values	O
allowed	O
for	O
each	O
index	O
may	O
also	O
be	O
included	O
in	O
the	O
dope	B-Data_Structure
vector	I-Data_Structure
.	O
</s>
<s>
The	O
dope	B-Data_Structure
vector	I-Data_Structure
is	O
a	O
complete	O
handle	O
for	O
the	O
array	O
,	O
and	O
is	O
a	O
convenient	O
way	O
to	O
pass	O
arrays	O
as	O
arguments	O
to	O
procedures	O
.	O
</s>
<s>
Many	O
useful	O
array	O
slicing	O
operations	O
(	O
such	O
as	O
selecting	O
a	O
sub-array	O
,	O
swapping	O
indices	O
,	O
or	O
reversing	O
the	O
direction	O
of	O
the	O
indices	O
)	O
can	O
be	O
performed	O
very	O
efficiently	O
by	O
manipulating	O
the	O
dope	B-Data_Structure
vector	I-Data_Structure
.	O
</s>
<s>
Often	O
the	O
coefficients	O
are	O
chosen	O
so	O
that	O
the	O
elements	O
occupy	O
a	O
contiguous	B-Architecture
area	O
of	O
memory	O
.	O
</s>
<s>
Even	O
if	O
arrays	O
are	O
always	O
created	O
with	O
contiguous	B-Architecture
elements	O
,	O
some	O
array	O
slicing	O
operations	O
may	O
create	O
non-contiguous	O
sub-arrays	O
from	O
them	O
.	O
</s>
<s>
In	O
the	O
row-major	B-Data_Structure
order	I-Data_Structure
layout	O
(	O
adopted	O
by	O
C	B-Language
for	O
statically	O
declared	O
arrays	O
)	O
,	O
the	O
elements	O
in	O
each	O
row	O
are	O
stored	O
in	O
consecutive	O
positions	O
and	O
all	O
of	O
the	O
elements	O
of	O
a	O
row	O
have	O
a	O
lower	O
address	O
than	O
any	O
of	O
the	O
elements	O
of	O
a	O
consecutive	O
row	O
:	O
</s>
<s>
In	O
column-major	B-Data_Structure
order	I-Data_Structure
(	O
traditionally	O
used	O
by	O
Fortran	B-Application
)	O
,	O
the	O
elements	O
in	O
each	O
column	O
are	O
consecutive	O
in	O
memory	O
and	O
all	O
of	O
the	O
elements	O
of	O
a	O
column	O
have	O
a	O
lower	O
address	O
than	O
any	O
of	O
the	O
elements	O
of	O
a	O
consecutive	O
column	O
:	O
</s>
<s>
For	O
arrays	O
with	O
three	O
or	O
more	O
indices	O
,	O
"	O
row	B-Data_Structure
major	I-Data_Structure
order	O
"	O
puts	O
in	O
consecutive	O
positions	O
any	O
two	O
elements	O
whose	O
index	O
tuples	B-Application
differ	O
only	O
by	O
one	O
in	O
the	O
last	O
index	O
.	O
</s>
<s>
In	O
systems	O
which	O
use	O
processor	B-General_Concept
cache	I-General_Concept
or	O
virtual	B-Architecture
memory	I-Architecture
,	O
scanning	O
an	O
array	O
is	O
much	O
faster	O
if	O
successive	O
elements	O
are	O
stored	O
in	O
consecutive	O
positions	O
in	O
memory	O
,	O
rather	O
than	O
sparsely	O
scattered	O
.	O
</s>
<s>
For	O
example	O
,	O
when	O
computing	O
the	O
product	O
A·B	O
of	O
two	O
matrices	B-Architecture
,	O
it	O
would	O
be	O
best	O
to	O
have	O
A	O
stored	O
in	O
row-major	B-Data_Structure
order	I-Data_Structure
,	O
and	O
B	O
in	O
column-major	B-Data_Structure
order	I-Data_Structure
.	O
</s>
<s>
However	O
,	O
by	O
allocating	O
a	O
new	O
array	O
and	O
copying	O
the	O
contents	O
of	O
the	O
old	O
array	O
to	O
it	O
,	O
it	O
is	O
possible	O
to	O
effectively	O
implement	O
a	O
dynamic	O
version	O
of	O
an	O
array	O
;	O
see	O
dynamic	B-Data_Structure
array	I-Data_Structure
.	O
</s>
<s>
Some	O
array	B-Data_Structure
data	I-Data_Structure
structures	I-Data_Structure
do	O
not	O
reallocate	O
storage	O
,	O
but	O
do	O
store	O
a	O
count	O
of	O
the	O
number	O
of	O
elements	O
of	O
the	O
array	O
in	O
use	O
,	O
called	O
the	O
count	O
or	O
size	O
.	O
</s>
<s>
This	O
effectively	O
makes	O
the	O
array	O
a	O
dynamic	B-Data_Structure
array	I-Data_Structure
with	O
a	O
fixed	O
maximum	O
size	O
or	O
capacity	O
;	O
Pascal	O
strings	O
are	O
examples	O
of	O
this	O
.	O
</s>
<s>
In	O
an	O
array	O
with	O
element	O
size	O
k	O
and	O
on	O
a	O
machine	O
with	O
a	O
cache	O
line	O
size	O
of	O
B	O
bytes	O
,	O
iterating	O
through	O
an	O
array	O
of	O
n	O
elements	O
requires	O
the	O
minimum	O
of	O
ceiling( 	O
nk/B	O
)	O
cache	O
misses	O
,	O
because	O
its	O
elements	O
occupy	O
contiguous	B-Architecture
memory	O
locations	O
.	O
</s>
<s>
As	O
a	O
consequence	O
,	O
sequential	O
iteration	O
over	O
an	O
array	O
is	O
noticeably	O
faster	O
in	O
practice	O
than	O
iteration	O
over	O
many	O
other	O
data	B-General_Concept
structures	I-General_Concept
,	O
a	O
property	O
called	O
locality	B-General_Concept
of	I-General_Concept
reference	I-General_Concept
(	O
this	O
does	O
not	O
mean	O
however	O
,	O
that	O
using	O
a	O
perfect	B-Algorithm
hash	I-Algorithm
or	O
trivial	O
hash	O
within	O
the	O
same	O
(	O
local	O
)	O
array	O
,	O
will	O
not	O
be	O
even	O
faster	O
-	O
and	O
achievable	O
in	O
constant	O
time	O
)	O
.	O
</s>
<s>
Libraries	O
provide	O
low-level	O
optimized	O
facilities	O
for	O
copying	O
ranges	O
of	O
memory	O
(	O
such	O
as	O
memcpy	B-Language
)	O
which	O
can	O
be	O
used	O
to	O
move	O
contiguous	B-Architecture
blocks	O
of	O
array	B-Data_Structure
elements	I-Data_Structure
significantly	O
faster	O
than	O
can	O
be	O
achieved	O
through	O
individual	O
element	O
access	O
.	O
</s>
<s>
The	O
speedup	O
of	O
such	O
optimized	O
routines	O
varies	O
by	O
array	B-Data_Structure
element	I-Data_Structure
size	O
,	O
architecture	O
,	O
and	O
implementation	O
.	O
</s>
<s>
Memory-wise	O
,	O
arrays	O
are	O
compact	O
data	B-General_Concept
structures	I-General_Concept
with	O
no	O
per-element	O
overhead	O
.	O
</s>
<s>
It	O
can	O
also	O
happen	O
that	O
elements	O
stored	O
in	O
an	O
array	O
require	O
less	O
memory	O
than	O
the	O
same	O
elements	O
stored	O
in	O
individual	O
variables	O
,	O
because	O
several	O
array	B-Data_Structure
elements	I-Data_Structure
can	O
be	O
stored	O
in	O
a	O
single	O
word	O
;	O
such	O
arrays	O
are	O
often	O
called	O
packed	O
arrays	O
.	O
</s>
<s>
An	O
extreme	O
(	O
but	O
commonly	O
used	O
)	O
case	O
is	O
the	O
bit	B-Data_Structure
array	I-Data_Structure
,	O
where	O
every	O
bit	O
represents	O
a	O
single	O
element	O
.	O
</s>
<s>
Array	O
accesses	O
with	O
statically	O
predictable	O
access	O
patterns	O
are	O
a	O
major	O
source	O
of	O
data	B-Operating_System
parallelism	I-Operating_System
.	O
</s>
<s>
Dynamic	B-Data_Structure
arrays	I-Data_Structure
or	O
growable	B-Data_Structure
arrays	I-Data_Structure
are	O
similar	O
to	O
arrays	O
but	O
add	O
the	O
ability	O
to	O
insert	O
and	O
delete	O
elements	O
;	O
adding	O
and	O
deleting	O
at	O
the	O
end	O
is	O
particularly	O
efficient	O
.	O
</s>
<s>
Associative	B-Application
arrays	I-Application
provide	O
a	O
mechanism	O
for	O
array-like	O
functionality	O
without	O
huge	O
storage	O
overheads	O
when	O
the	O
index	O
values	O
are	O
sparse	O
.	O
</s>
<s>
Specialized	O
associative	B-Application
arrays	I-Application
with	O
integer	O
keys	O
include	O
Patricia	O
tries	O
,	O
Judy	B-Data_Structure
arrays	I-Data_Structure
,	O
and	O
van	B-Application
Emde	I-Application
Boas	I-Application
trees	I-Application
.	O
</s>
<s>
Balanced	B-Data_Structure
trees	I-Data_Structure
require	O
O(log n )	O
time	O
for	O
indexed	O
access	O
,	O
but	O
also	O
permit	O
inserting	O
or	O
deleting	O
elements	O
in	O
O(log n )	O
time	O
,	O
whereas	O
growable	B-Data_Structure
arrays	I-Data_Structure
require	O
linear	O
(Θ(n )	O
)	O
time	O
to	O
insert	O
or	O
delete	O
elements	O
at	O
an	O
arbitrary	O
position	O
.	O
</s>
<s>
Linked	B-Data_Structure
lists	I-Data_Structure
allow	O
constant	O
time	O
removal	O
and	O
insertion	O
in	O
the	O
middle	O
but	O
take	O
linear	O
time	O
for	O
indexed	O
access	O
.	O
</s>
<s>
An	O
Iliffe	B-Data_Structure
vector	I-Data_Structure
is	O
an	O
alternative	O
to	O
a	O
multidimensional	O
array	O
structure	O
.	O
</s>
<s>
For	O
two	O
dimensions	O
,	O
in	O
particular	O
,	O
this	O
alternative	O
structure	O
would	O
be	O
a	O
vector	O
of	O
pointers	O
to	O
vectors	O
,	O
one	O
for	O
each	O
row( pointer	O
on	O
c	B-Language
or	O
c++	B-Language
)	O
.	O
</s>
<s>
This	O
alternative	O
structure	O
allows	O
jagged	B-Data_Structure
arrays	I-Data_Structure
,	O
where	O
each	O
row	O
may	O
have	O
a	O
different	O
size	O
—	O
or	O
,	O
in	O
general	O
,	O
where	O
the	O
valid	O
range	O
of	O
each	O
index	O
depends	O
on	O
the	O
values	O
of	O
all	O
preceding	O
indices	O
.	O
</s>
<s>
This	O
should	O
not	O
be	O
confused	O
with	O
the	O
dimension	O
of	O
the	O
set	O
of	O
all	O
matrices	B-Architecture
with	O
a	O
given	O
domain	O
,	O
that	O
is	O
,	O
the	O
number	O
of	O
elements	O
in	O
the	O
array	O
.	O
</s>
<s>
For	O
example	O
,	O
an	O
array	O
with	O
5	O
rows	O
and	O
4	O
columns	O
is	O
two-dimensional	O
,	O
but	O
such	O
matrices	B-Architecture
form	O
a	O
20-dimensional	O
space	O
.	O
</s>
