<s>
In	O
computer	O
programming	O
,	O
an	O
unrolled	B-Data_Structure
linked	I-Data_Structure
list	I-Data_Structure
is	O
a	O
variation	O
on	O
the	O
linked	B-Data_Structure
list	I-Data_Structure
which	O
stores	O
multiple	O
elements	O
in	O
each	O
node	O
.	O
</s>
<s>
It	O
can	O
dramatically	O
increase	O
cache	B-General_Concept
performance	O
,	O
while	O
decreasing	O
the	O
memory	O
overhead	O
associated	O
with	O
storing	O
list	O
metadata	O
such	O
as	O
references	O
.	O
</s>
<s>
It	O
is	O
related	O
to	O
the	O
B-tree	B-Architecture
.	O
</s>
<s>
A	O
typical	O
unrolled	B-Data_Structure
linked	I-Data_Structure
list	I-Data_Structure
node	O
looks	O
like	O
this	O
:	O
</s>
<s>
array	B-Data_Structure
elements	I-Data_Structure
//	O
an	O
array	B-Data_Structure
of	O
numElements	O
elements	O
,	O
</s>
<s>
Each	O
node	O
holds	O
up	O
to	O
a	O
certain	O
maximum	O
number	O
of	O
elements	O
,	O
typically	O
just	O
large	O
enough	O
so	O
that	O
the	O
node	O
fills	O
a	O
single	O
cache	B-General_Concept
line	I-General_Concept
or	O
a	O
small	O
multiple	O
thereof	O
.	O
</s>
<s>
A	O
position	O
in	O
the	O
list	O
is	O
indicated	O
by	O
both	O
a	O
reference	O
to	O
the	O
node	O
and	O
a	O
position	O
in	O
the	O
elements	O
array	B-Data_Structure
.	O
</s>
<s>
It	O
is	O
also	O
possible	O
to	O
include	O
a	O
previous	O
pointer	O
for	O
an	O
unrolled	O
doubly	B-Data_Structure
linked	I-Data_Structure
list	I-Data_Structure
.	O
</s>
<s>
To	O
insert	O
a	O
new	O
element	O
,	O
we	O
find	O
the	O
node	O
the	O
element	O
should	O
be	O
in	O
and	O
insert	O
the	O
element	O
into	O
the	O
elements	O
array	B-Data_Structure
,	O
incrementing	O
numElements	O
.	O
</s>
<s>
If	O
the	O
array	B-Data_Structure
is	O
already	O
full	O
,	O
we	O
first	O
insert	O
a	O
new	O
node	O
either	O
preceding	O
or	O
following	O
the	O
current	O
one	O
and	O
move	O
half	O
of	O
the	O
elements	O
in	O
the	O
current	O
node	O
into	O
it	O
.	O
</s>
<s>
To	O
remove	O
an	O
element	O
,	O
we	O
find	O
the	O
node	O
it	O
is	O
in	O
and	O
delete	O
it	O
from	O
the	O
elements	O
array	B-Data_Structure
,	O
decrementing	O
numElements	O
.	O
</s>
<s>
One	O
of	O
the	O
primary	O
benefits	O
of	O
unrolled	B-Data_Structure
linked	I-Data_Structure
lists	I-Data_Structure
is	O
decreased	O
storage	O
requirements	O
.	O
</s>
<s>
m	O
=	O
maxElements	O
,	O
the	O
maximum	O
number	O
of	O
elements	O
in	O
each	O
elements	O
array	B-Data_Structure
;	O
</s>
<s>
For	O
comparison	O
,	O
ordinary	O
linked	B-Data_Structure
lists	I-Data_Structure
require	O
space	O
,	O
although	O
v	O
may	O
be	O
smaller	O
,	O
and	O
arrays	O
,	O
one	O
of	O
the	O
most	O
compact	O
data	O
structures	O
,	O
require	O
space	O
.	O
</s>
<s>
Unrolled	B-Data_Structure
linked	I-Data_Structure
lists	I-Data_Structure
effectively	O
spread	O
the	O
overhead	O
v	O
over	O
a	O
number	O
of	O
elements	O
of	O
the	O
list	O
.	O
</s>
<s>
Moreover	O
,	O
many	O
popular	O
memory	O
allocators	O
will	O
keep	O
a	O
small	O
amount	O
of	O
metadata	O
for	O
each	O
node	O
allocated	O
,	O
increasing	O
the	O
effective	O
overhead	O
v	O
.	O
Both	O
of	O
these	O
make	O
unrolled	B-Data_Structure
linked	I-Data_Structure
lists	I-Data_Structure
more	O
attractive	O
.	O
</s>
<s>
Because	O
unrolled	B-Data_Structure
linked	I-Data_Structure
list	I-Data_Structure
nodes	O
each	O
store	O
a	O
count	O
next	O
to	O
the	O
next	O
field	O
,	O
retrieving	O
the	O
kth	O
element	O
of	O
an	O
unrolled	B-Data_Structure
linked	I-Data_Structure
list	I-Data_Structure
(	O
indexing	O
)	O
can	O
be	O
done	O
in	O
n/m	O
+	O
1	O
cache	B-General_Concept
misses	O
,	O
up	O
to	O
a	O
factor	O
of	O
m	O
better	O
than	O
ordinary	O
linked	B-Data_Structure
lists	I-Data_Structure
.	O
</s>
<s>
Additionally	O
,	O
if	O
the	O
size	O
of	O
each	O
element	O
is	O
small	O
compared	O
to	O
the	O
cache	B-General_Concept
line	I-General_Concept
size	O
,	O
the	O
list	O
can	O
be	O
traversed	O
in	O
order	O
with	O
fewer	O
cache	B-General_Concept
misses	O
than	O
ordinary	O
linked	B-Data_Structure
lists	I-Data_Structure
.	O
</s>
