<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
suffix	B-Algorithm
array	I-Algorithm
is	O
a	O
sorted	O
array	B-Data_Structure
of	O
all	O
suffixes	O
of	O
a	O
string	O
.	O
</s>
<s>
Suffix	B-Algorithm
arrays	I-Algorithm
were	O
introduced	O
by	O
as	O
a	O
simple	O
,	O
space	O
efficient	O
alternative	O
to	O
suffix	B-Architecture
trees	I-Architecture
.	O
</s>
<s>
They	O
had	O
independently	O
been	O
discovered	O
by	O
Gaston	O
Gonnet	O
in	O
1987	O
under	O
the	O
name	O
PAT	O
array	B-Data_Structure
.	O
</s>
<s>
gave	O
the	O
first	O
in-place	O
time	O
suffix	B-Algorithm
array	I-Algorithm
construction	O
algorithm	O
that	O
is	O
optimal	O
both	O
in	O
time	O
and	O
space	O
,	O
where	O
in-place	O
means	O
that	O
the	O
algorithm	O
only	O
needs	O
additional	O
space	O
beyond	O
the	O
input	O
string	O
and	O
the	O
output	O
suffix	B-Algorithm
array	I-Algorithm
.	O
</s>
<s>
Enhanced	O
suffix	B-Algorithm
arrays	I-Algorithm
(	O
ESAs	O
)	O
are	O
suffix	B-Algorithm
arrays	I-Algorithm
with	O
additional	O
tables	O
that	O
reproduce	O
the	O
full	O
functionality	O
of	O
suffix	B-Architecture
trees	I-Architecture
preserving	O
the	O
same	O
time	O
and	O
memory	O
complexity	O
.	O
</s>
<s>
The	O
suffix	B-Algorithm
array	I-Algorithm
for	O
a	O
subset	O
of	O
all	O
suffixes	O
of	O
a	O
string	O
is	O
called	O
sparse	O
suffix	B-Algorithm
array	I-Algorithm
.	O
</s>
<s>
The	O
suffix	B-Algorithm
array	I-Algorithm
of	O
is	O
now	O
defined	O
to	O
be	O
an	O
array	B-Data_Structure
of	O
integers	O
providing	O
the	O
starting	O
positions	O
of	O
suffixes	O
of	O
in	O
lexicographical	O
order	O
.	O
</s>
<s>
The	O
suffix	B-Algorithm
array	I-Algorithm
contains	O
the	O
starting	O
positions	O
of	O
these	O
sorted	O
suffixes	O
:	O
</s>
<s>
The	O
suffix	B-Algorithm
array	I-Algorithm
with	O
the	O
suffixes	O
written	O
out	O
vertically	O
underneath	O
for	O
clarity	O
:	O
</s>
<s>
Suffix	B-Algorithm
arrays	I-Algorithm
are	O
closely	O
related	O
to	O
suffix	B-Architecture
trees	I-Architecture
:	O
</s>
<s>
Suffix	B-Algorithm
arrays	I-Algorithm
can	O
be	O
constructed	O
by	O
performing	O
a	O
depth-first	B-Algorithm
traversal	I-Algorithm
of	O
a	O
suffix	B-Architecture
tree	I-Architecture
.	O
</s>
<s>
The	O
suffix	B-Algorithm
array	I-Algorithm
corresponds	O
to	O
the	O
leaf-labels	O
given	O
in	O
the	O
order	O
in	O
which	O
these	O
are	O
visited	O
during	O
the	O
traversal	O
,	O
if	O
edges	O
are	O
visited	O
in	O
the	O
lexicographical	O
order	O
of	O
their	O
first	O
character	O
.	O
</s>
<s>
A	O
suffix	B-Architecture
tree	I-Architecture
can	O
be	O
constructed	O
in	O
linear	O
time	O
by	O
using	O
a	O
combination	O
of	O
suffix	B-Algorithm
array	I-Algorithm
and	O
LCP	B-Data_Structure
array	I-Data_Structure
.	O
</s>
<s>
For	O
a	O
description	O
of	O
the	O
algorithm	O
,	O
see	O
the	O
corresponding	O
section	O
in	O
the	O
LCP	B-Data_Structure
array	I-Data_Structure
article	O
.	O
</s>
<s>
It	O
has	O
been	O
shown	O
that	O
every	O
suffix	B-Architecture
tree	I-Architecture
algorithm	O
can	O
be	O
systematically	O
replaced	O
with	O
an	O
algorithm	O
that	O
uses	O
a	O
suffix	B-Algorithm
array	I-Algorithm
enhanced	O
with	O
additional	O
information	O
(	O
such	O
as	O
the	O
LCP	B-Data_Structure
array	I-Data_Structure
)	O
and	O
solves	O
the	O
same	O
problem	O
in	O
the	O
same	O
time	O
complexity	O
.	O
</s>
<s>
Advantages	O
of	O
suffix	B-Algorithm
arrays	I-Algorithm
over	O
suffix	B-Architecture
trees	I-Architecture
include	O
improved	O
space	O
requirements	O
,	O
simpler	O
linear	O
time	O
construction	O
algorithms	O
(	O
e.g.	O
,	O
compared	O
to	O
Ukkonen	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
)	O
and	O
improved	O
cache	O
locality	O
.	O
</s>
<s>
Suffix	B-Algorithm
arrays	I-Algorithm
were	O
introduced	O
by	O
in	O
order	O
to	O
improve	O
over	O
the	O
space	O
requirements	O
of	O
suffix	B-Architecture
trees	I-Architecture
:	O
Suffix	B-Algorithm
arrays	I-Algorithm
store	O
integers	O
.	O
</s>
<s>
Assuming	O
an	O
integer	O
requires	O
bytes	O
,	O
a	O
suffix	B-Algorithm
array	I-Algorithm
requires	O
bytes	O
in	O
total	O
.	O
</s>
<s>
This	O
is	O
significantly	O
less	O
than	O
the	O
bytes	O
which	O
are	O
required	O
by	O
a	O
careful	O
suffix	B-Architecture
tree	I-Architecture
implementation	O
.	O
</s>
<s>
However	O
,	O
in	O
certain	O
applications	O
,	O
the	O
space	O
requirements	O
of	O
suffix	B-Algorithm
arrays	I-Algorithm
may	O
still	O
be	O
prohibitive	O
.	O
</s>
<s>
Analyzed	O
in	O
bits	O
,	O
a	O
suffix	B-Algorithm
array	I-Algorithm
requires	O
space	O
,	O
whereas	O
the	O
original	O
text	O
over	O
an	O
alphabet	O
of	O
size	O
only	O
requires	O
bits	O
.	O
</s>
<s>
For	O
a	O
human	O
genome	O
with	O
and	O
the	O
suffix	B-Algorithm
array	I-Algorithm
would	O
therefore	O
occupy	O
about	O
16	O
times	O
more	O
memory	O
than	O
the	O
genome	O
itself	O
.	O
</s>
<s>
Such	O
discrepancies	O
motivated	O
a	O
trend	O
towards	O
compressed	B-Algorithm
suffix	I-Algorithm
arrays	I-Algorithm
and	O
BWT-based	O
compressed	O
full-text	O
indices	O
such	O
as	O
the	O
FM-index	B-Algorithm
.	O
</s>
<s>
A	O
suffix	B-Architecture
tree	I-Architecture
can	O
be	O
built	O
in	O
and	O
can	O
be	O
converted	O
into	O
a	O
suffix	B-Algorithm
array	I-Algorithm
by	O
traversing	O
the	O
tree	O
depth-first	B-Algorithm
also	O
in	O
,	O
so	O
there	O
exist	O
algorithms	O
that	O
can	O
build	O
a	O
suffix	B-Algorithm
array	I-Algorithm
in	O
.	O
</s>
<s>
A	O
naive	O
approach	O
to	O
construct	O
a	O
suffix	B-Algorithm
array	I-Algorithm
is	O
to	O
use	O
a	O
comparison-based	B-Algorithm
sorting	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
The	O
algorithm	O
is	O
also	O
rather	O
simple	O
(	O
100	O
LOC	O
)	O
and	O
can	O
be	O
enhanced	O
to	O
simultaneously	O
construct	O
the	O
LCP	B-Data_Structure
array	I-Data_Structure
.	O
</s>
<s>
The	O
SA-IS	O
algorithm	O
is	O
one	O
of	O
the	O
fastest	O
known	O
suffix	B-Algorithm
array	I-Algorithm
construction	O
algorithms	O
.	O
</s>
<s>
Beside	O
time	O
and	O
space	O
requirements	O
,	O
suffix	B-Algorithm
array	I-Algorithm
construction	O
algorithms	O
are	O
also	O
differentiated	O
by	O
their	O
supported	O
alphabet	O
:	O
constant	O
alphabets	O
where	O
the	O
alphabet	O
size	O
is	O
bound	O
by	O
a	O
constant	O
,	O
integer	O
alphabets	O
where	O
characters	O
are	O
integers	O
in	O
a	O
range	O
depending	O
on	O
and	O
general	O
alphabets	O
where	O
only	O
character	O
comparisons	O
are	O
allowed	O
.	O
</s>
<s>
Most	O
suffix	B-Algorithm
array	I-Algorithm
construction	O
algorithms	O
are	O
based	O
on	O
one	O
of	O
the	O
following	O
approaches	O
:	O
</s>
<s>
Recursive	O
algorithms	O
follow	O
the	O
approach	O
of	O
the	O
suffix	B-Architecture
tree	I-Architecture
construction	O
algorithm	O
by	O
to	O
recursively	O
sort	O
a	O
subset	O
of	O
suffixes	O
.	O
</s>
<s>
This	O
subset	O
is	O
then	O
used	O
to	O
infer	O
a	O
suffix	B-Algorithm
array	I-Algorithm
of	O
the	O
remaining	O
suffixes	O
.	O
</s>
<s>
Both	O
of	O
these	O
suffix	B-Algorithm
arrays	I-Algorithm
are	O
then	O
merged	O
to	O
compute	O
the	O
final	O
suffix	B-Algorithm
array	I-Algorithm
.	O
</s>
<s>
It	O
runs	O
in	O
linear	O
time	O
and	O
has	O
successfully	O
been	O
used	O
as	O
the	O
basis	O
for	O
parallel	O
and	O
external	B-Application
memory	I-Application
suffix	B-Algorithm
array	I-Algorithm
construction	O
algorithms	O
.	O
</s>
<s>
Recent	O
work	O
by	O
proposes	O
an	O
algorithm	O
for	O
updating	O
the	O
suffix	B-Algorithm
array	I-Algorithm
of	O
a	O
text	O
that	O
has	O
been	O
edited	O
instead	O
of	O
rebuilding	O
a	O
new	O
suffix	B-Algorithm
array	I-Algorithm
from	O
scratch	O
.	O
</s>
<s>
Even	O
if	O
the	O
theoretical	O
worst-case	O
time	O
complexity	O
is	O
,	O
it	O
appears	O
to	O
perform	O
well	O
in	O
practice	O
:	O
experimental	O
results	O
from	O
the	O
authors	O
showed	O
that	O
their	O
implementation	O
of	O
dynamic	O
suffix	B-Algorithm
arrays	I-Algorithm
is	O
generally	O
more	O
efficient	O
than	O
rebuilding	O
when	O
considering	O
the	O
insertion	O
of	O
a	O
reasonable	O
number	O
of	O
letters	O
in	O
the	O
original	O
text	O
.	O
</s>
<s>
In	O
practical	O
open	B-License
source	I-License
work	O
,	O
a	O
commonly	O
used	O
routine	O
for	O
suffix	B-Algorithm
array	I-Algorithm
construction	O
was	O
qsufsort	O
,	O
based	O
on	O
the	O
1999	O
Larsson-Sadakane	O
algorithm	O
.	O
</s>
<s>
It	O
too	O
can	O
be	O
modified	O
to	O
compute	O
an	O
LCP	B-Data_Structure
array	I-Data_Structure
.	O
</s>
<s>
The	O
concept	O
of	O
a	O
suffix	B-Algorithm
array	I-Algorithm
can	O
be	O
extended	O
to	O
more	O
than	O
one	O
string	O
.	O
</s>
<s>
This	O
is	O
called	O
a	O
generalized	O
suffix	B-Algorithm
array	I-Algorithm
(	O
or	O
GSA	O
)	O
,	O
a	O
suffix	B-Algorithm
array	I-Algorithm
that	O
contains	O
all	O
suffixes	O
for	O
a	O
set	O
of	O
strings	O
(	O
for	O
example	O
,	O
and	O
is	O
lexicographically	O
sorted	O
with	O
all	O
suffixes	O
of	O
each	O
string	O
.	O
</s>
<s>
The	O
suffix	B-Algorithm
array	I-Algorithm
of	O
a	O
string	O
can	O
be	O
used	O
as	O
an	O
index	B-Application
to	O
quickly	O
locate	O
every	O
occurrence	O
of	O
a	O
substring	O
pattern	O
within	O
the	O
string	O
.	O
</s>
<s>
Thanks	O
to	O
the	O
lexicographical	O
ordering	O
,	O
these	O
suffixes	O
will	O
be	O
grouped	O
together	O
in	O
the	O
suffix	B-Algorithm
array	I-Algorithm
and	O
can	O
be	O
found	O
efficiently	O
with	O
two	O
binary	O
searches	O
.	O
</s>
<s>
describe	O
how	O
this	O
bound	O
can	O
be	O
improved	O
to	O
time	O
using	O
LCP	B-Data_Structure
information	O
.	O
</s>
<s>
improve	O
the	O
bound	O
even	O
further	O
and	O
achieve	O
a	O
search	O
time	O
of	O
for	O
constant	O
alphabet	O
size	O
,	O
as	O
known	O
from	O
suffix	B-Architecture
trees	I-Architecture
.	O
</s>
<s>
Suffix	O
sorting	O
algorithms	O
can	O
be	O
used	O
to	O
compute	O
the	O
Burrows	B-Algorithm
–	I-Algorithm
Wheeler	I-Algorithm
transform	I-Algorithm
(	O
BWT	B-Algorithm
)	O
.	O
</s>
<s>
The	O
BWT	B-Algorithm
requires	O
sorting	O
of	O
all	O
cyclic	O
permutations	O
of	O
a	O
string	O
.	O
</s>
<s>
If	O
this	O
string	O
ends	O
in	O
a	O
special	O
end-of-string	O
character	O
that	O
is	O
lexicographically	O
smaller	O
than	O
all	O
other	O
character	O
(	O
i.e.	O
,	O
$	O
)	O
,	O
then	O
the	O
order	O
of	O
the	O
sorted	O
rotated	O
BWT	B-Algorithm
matrix	O
corresponds	O
to	O
the	O
order	O
of	O
suffixes	O
in	O
a	O
suffix	B-Algorithm
array	I-Algorithm
.	O
</s>
<s>
The	O
BWT	B-Algorithm
can	O
therefore	O
be	O
computed	O
in	O
linear	O
time	O
by	O
first	O
constructing	O
a	O
suffix	B-Algorithm
array	I-Algorithm
of	O
the	O
text	O
and	O
then	O
deducing	O
the	O
BWT	B-Algorithm
string	O
:	O
.	O
</s>
<s>
Suffix	B-Algorithm
arrays	I-Algorithm
can	O
also	O
be	O
used	O
to	O
look	O
up	O
substrings	O
in	O
example-based	B-General_Concept
machine	I-General_Concept
translation	I-General_Concept
,	O
demanding	O
much	O
less	O
storage	O
than	O
a	O
full	O
phrase	O
table	O
as	O
used	O
in	O
Statistical	B-General_Concept
machine	I-General_Concept
translation	I-General_Concept
.	O
</s>
<s>
Many	O
additional	O
applications	O
of	O
the	O
suffix	B-Algorithm
array	I-Algorithm
require	O
the	O
LCP	B-Data_Structure
array	I-Data_Structure
.	O
</s>
<s>
Suffix	B-Architecture
trees	I-Architecture
are	O
powerful	O
data	O
structures	O
that	O
have	O
wide	O
application	O
in	O
areas	O
of	O
pattern	O
and	O
string	O
matching	O
,	O
indexing	O
and	O
textual	O
statistics	O
.	O
</s>
<s>
To	O
overcome	O
this	O
drawback	O
,	O
Enhanced	O
Suffix	B-Algorithm
Arrays	I-Algorithm
were	O
developed	O
that	O
are	O
data	O
structures	O
consisting	O
of	O
suffix	B-Algorithm
arrays	I-Algorithm
and	O
an	O
additional	O
table	O
called	O
the	O
child	O
table	O
that	O
contains	O
the	O
information	O
about	O
the	O
parent-child	O
relationship	O
between	O
the	O
nodes	O
in	O
the	O
suffix	B-Architecture
tree	I-Architecture
.	O
</s>
<s>
Enhanced	O
suffix	B-Algorithm
arrays	I-Algorithm
are	O
superior	O
in	O
terms	O
of	O
both	O
space	O
efficiency	O
and	O
time	O
complexity	O
and	O
are	O
easy	O
to	O
implement	O
.	O
</s>
<s>
Moreover	O
,	O
they	O
can	O
be	O
applied	O
to	O
any	O
algorithm	O
that	O
uses	O
a	O
suffix	B-Architecture
tree	I-Architecture
by	O
using	O
an	O
abstract	O
concept	O
lcp-interval	O
trees	O
.	O
</s>
<s>
The	O
time	O
complexity	O
for	O
searching	O
a	O
pattern	O
in	O
an	O
enhanced	O
suffix	B-Algorithm
array	I-Algorithm
is	O
O( m|Σ|	O
)	O
.	O
</s>
<s>
The	O
suffix	B-Algorithm
array	I-Algorithm
of	O
the	O
string	O
is	O
an	O
array	B-Data_Structure
of	O
n	O
integers	O
in	O
the	O
range	O
of	O
0	O
to	O
n	O
that	O
represents	O
the	O
n+1	O
suffixes	O
of	O
the	O
string	O
including	O
the	O
special	O
character	O
#	O
.	O
</s>
<s>
The	O
suffix	B-Algorithm
array	I-Algorithm
is	O
composed	O
of	O
two	O
arrays	O
:	O
</s>
<s>
pos	O
array	B-Data_Structure
n	O
...	O
It	O
represents	O
a	O
sorted	O
list	O
of	O
all	O
S	O
suffixes	O
.	O
</s>
<s>
Only	O
the	O
initial	O
positions	O
of	O
the	O
suffixes	O
are	O
stored	O
in	O
the	O
array	B-Data_Structure
to	O
reduce	O
the	O
space	O
complexity	O
since	O
the	O
suffixes	O
are	O
too	O
large	O
.	O
</s>
<s>
lcp	B-Data_Structure
array	I-Data_Structure
n	O
...	O
It	O
is	O
an	O
array	B-Data_Structure
of	O
n	O
integers	O
that	O
maintains	O
the	O
lengths	O
of	O
the	O
longest	O
common	O
prefix	O
of	O
two	O
consecutive	O
suffixes	O
stored	O
in	O
the	O
pos	O
array	B-Data_Structure
.	O
</s>
<s>
For	O
a	O
suffix	B-Algorithm
array	I-Algorithm
of	O
S	O
,	O
the	O
lcp-interval	O
associated	O
with	O
the	O
corresponding	O
node	O
of	O
suffix	B-Architecture
tree	I-Architecture
of	O
S	O
can	O
be	O
defined	O
as	O
:	O
</s>
<s>
The	O
length	O
of	O
the	O
longest	O
common	O
prefix	O
of	O
pos[ i	O
−	O
1 ]	O
and	O
pos[i]	O
is	O
stored	O
in	O
lcp[i],where	O
2	O
≤	O
i	O
≤	O
n	O
.	O
The	O
lcp-interval	O
portrays	O
the	O
same	O
parent-child	O
relationship	O
as	O
that	O
among	O
the	O
associated	O
nodes	O
in	O
the	O
suffix	B-Architecture
tree	I-Architecture
of	O
S.This	O
shows	O
that	O
if	O
the	O
corresponding	O
node	O
of	O
i	O
..	O
j	O
is	O
a	O
child	O
of	O
the	O
corresponding	O
node	O
of	O
k	O
..	O
l	O
a	O
lcp-interval	O
i	O
..	O
j	O
is	O
a	O
child	O
interval	O
of	O
another	O
lcp-interval	O
k	O
..	O
l	O
.	O
</s>
<s>
If	O
k	O
..	O
l	O
is	O
a	O
child	O
interval	O
of	O
i	O
..	O
j	O
a	O
lcp-interval	O
i	O
..	O
j	O
is	O
the	O
parent	O
interval	O
of	O
a	O
lcp-interval	O
k	O
..	O
l	O
.	O
</s>
<s>
The	O
information	O
about	O
the	O
edges	O
of	O
the	O
corresponding	O
suffix	B-Architecture
tree	I-Architecture
is	O
stored	O
and	O
maintained	O
by	O
the	O
up	O
and	O
down	O
arrays	O
.	O
</s>
<s>
The	O
nextlIndex	O
array	B-Data_Structure
stores	O
the	O
links	O
in	O
the	O
linked	O
list	O
used	O
for	O
node	O
branching	O
the	O
suffix	B-Architecture
tree	I-Architecture
.	O
</s>
<s>
The	O
up	O
,	O
down	O
and	O
nextlIndex	O
array	B-Data_Structure
are	O
defined	O
as	O
follows	O
:	O
</s>
<s>
The	O
element	O
up[i]	O
records	O
the	O
starting	O
index	B-Application
of	O
the	O
longest	O
lcp-second	O
interval	O
’s	O
child	O
interval	O
,	O
which	O
ends	O
at	O
index	B-Application
i-1	O
.	O
</s>
<s>
The	O
initial	O
index	B-Application
of	O
the	O
second	O
child	O
interval	O
of	O
the	O
longest	O
lcp-interval	O
,	O
starting	O
at	O
index	B-Application
i	O
is	O
stored	O
in	O
the	O
element	O
down[i]	O
.	O
</s>
<s>
If	O
and	O
only	O
if	O
the	O
interval	O
is	O
neither	O
the	O
first	O
child	O
nor	O
the	O
final	O
child	O
of	O
its	O
parent	O
,	O
the	O
element	O
nextlIndex[i]	O
contains	O
the	O
first	O
index	B-Application
of	O
the	O
next	O
sibling	O
interval	O
of	O
the	O
longest	O
lcp-interval	O
,	O
starting	O
at	O
index	B-Application
i	O
.	O
</s>
<s>
By	O
performing	O
a	O
bottom-up	O
traversal	O
of	O
the	O
lcp-interval	O
of	O
the	O
tree	O
,	O
the	O
child	O
table	O
can	O
be	O
constructed	O
in	O
linear	O
time	O
.	O
</s>
<s>
The	O
suffix	O
links	O
for	O
an	O
enhanced	O
suffix	B-Algorithm
array	I-Algorithm
can	O
be	O
computed	O
by	O
generating	O
the	O
suffix	O
link	O
interval	O
 [ 1 , .. , r ] 	O
for	O
each	O
j	O
..	O
interval	O
during	O
the	O
preprocessing	O
.	O
</s>
<s>
The	O
left	O
and	O
right	O
elements	O
l	O
and	O
r	O
of	O
the	O
interval	O
are	O
maintained	O
in	O
the	O
first	O
index	B-Application
of	O
 [ i , .. , j ] 	O
.	O
</s>
<s>
The	O
table	O
for	O
this	O
interval	O
ranges	O
from	O
0	O
to	O
n	O
.	O
The	O
suffix	O
link	O
table	O
is	O
constructed	O
by	O
the	O
left-to-right	O
breadth-first	O
traversal	O
of	O
the	O
lcp-interval	O
tree	O
.	O
</s>
<s>
When	O
the	O
lcp-value	O
>	O
0	O
,	O
for	O
every	O
l-interval[i,..,j]	O
in	O
the	O
list	O
,	O
link[i]	O
is	O
calculated	O
.	O
</s>
<s>
The	O
values	O
l	O
and	O
r	O
are	O
ultimately	O
stored	O
in	O
the	O
first	O
index	B-Application
of	O
 [ i , .. , j ] 	O
.	O
</s>
