<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
trie	B-General_Concept
,	O
also	O
called	O
digital	B-General_Concept
tree	I-General_Concept
or	O
prefix	B-General_Concept
tree	I-General_Concept
,	O
is	O
a	O
type	O
of	O
k-ary	O
search	B-Data_Structure
tree	I-Data_Structure
,	O
a	O
tree	B-Application
data	I-Application
structure	I-Application
used	O
for	O
locating	O
specific	O
keys	O
from	O
within	O
a	O
set	O
.	O
</s>
<s>
In	O
order	O
to	O
access	O
a	O
key	O
(	O
to	O
recover	O
its	O
value	O
,	O
change	O
it	O
,	O
or	O
remove	O
it	O
)	O
,	O
the	O
trie	B-General_Concept
is	O
traversed	O
depth-first	B-Algorithm
,	O
following	O
the	O
links	O
between	O
nodes	O
,	O
which	O
represent	O
each	O
character	O
in	O
the	O
key	O
.	O
</s>
<s>
Unlike	O
a	O
binary	B-Language
search	I-Language
tree	I-Language
,	O
nodes	O
in	O
the	O
trie	B-General_Concept
do	O
not	O
store	O
their	O
associated	O
key	O
.	O
</s>
<s>
Instead	O
,	O
a	O
node	O
's	O
position	O
in	O
the	O
trie	B-General_Concept
defines	O
the	O
key	O
with	O
which	O
it	O
is	O
associated	O
.	O
</s>
<s>
This	O
distributes	O
the	O
value	O
of	O
each	O
key	O
across	O
the	O
data	B-General_Concept
structure	I-General_Concept
,	O
and	O
means	O
that	O
not	O
every	O
node	O
necessarily	O
has	O
an	O
associated	O
value	O
.	O
</s>
<s>
All	O
the	O
children	O
of	O
a	O
node	O
have	O
a	O
common	O
prefix	O
of	O
the	O
string	O
associated	O
with	O
that	O
parent	B-Application
node	I-Application
,	O
and	O
the	O
root	O
is	O
associated	O
with	O
the	O
empty	O
string	O
.	O
</s>
<s>
This	O
task	O
of	O
storing	O
data	O
accessible	O
by	O
its	O
prefix	O
can	O
be	O
accomplished	O
in	O
a	O
memory-optimized	O
way	O
by	O
employing	O
a	O
radix	B-Data_Structure
tree	I-Data_Structure
.	O
</s>
<s>
Though	O
tries	B-General_Concept
can	O
be	O
keyed	O
by	O
character	O
strings	O
,	O
they	O
need	O
not	O
be	O
.	O
</s>
<s>
permutations	B-Algorithm
of	O
digits	O
or	O
shapes	O
.	O
</s>
<s>
In	O
particular	O
,	O
a	O
bitwise	O
trie	B-General_Concept
is	O
keyed	O
on	O
the	O
individual	O
bits	O
making	O
up	O
a	O
piece	O
of	O
fixed-length	O
binary	O
data	O
,	O
such	O
as	O
an	O
integer	O
or	O
memory	B-General_Concept
address	I-General_Concept
.	O
</s>
<s>
The	O
key	O
lookup	O
complexity	O
of	O
a	O
trie	B-General_Concept
remains	O
proportional	O
to	O
the	O
key	O
size	O
.	O
</s>
<s>
Specialized	O
trie	B-General_Concept
implementations	O
such	O
as	O
compressed	O
tries	B-General_Concept
are	O
used	O
to	O
deal	O
with	O
the	O
enormous	O
space	O
requirement	O
of	O
a	O
trie	B-General_Concept
in	O
naive	O
implementations	O
.	O
</s>
<s>
The	O
idea	O
of	O
a	O
trie	B-General_Concept
for	O
representing	O
a	O
set	O
of	O
strings	O
was	O
first	O
abstractly	O
described	O
by	O
Axel	O
Thue	O
in	O
1912	O
.	O
</s>
<s>
Tries	B-General_Concept
were	O
first	O
described	O
in	O
a	O
computer	O
context	O
by	O
René	O
de	O
la	O
Briandais	O
in	O
1959	O
.	O
</s>
<s>
The	O
idea	O
was	O
independently	O
described	O
in	O
1960	O
by	O
Edward	O
Fredkin	O
,	O
who	O
coined	O
the	O
term	O
trie	B-General_Concept
,	O
pronouncing	O
it	O
(	O
as	O
"	O
tree	B-Application
"	O
)	O
,	O
after	O
the	O
middle	O
syllable	O
of	O
retrieval	O
.	O
</s>
<s>
However	O
,	O
other	O
authors	O
pronounce	O
it	O
(	O
as	O
"	O
try	O
"	O
)	O
,	O
in	O
an	O
attempt	O
to	O
distinguish	O
it	O
verbally	O
from	O
"	O
tree	B-Application
"	O
.	O
</s>
<s>
Tries	B-General_Concept
are	O
a	O
form	O
of	O
string-indexed	O
look-up	O
data	B-General_Concept
structure	I-General_Concept
,	O
which	O
is	O
used	O
to	O
store	O
a	O
dictionary	O
list	O
of	O
words	O
that	O
can	O
be	O
searched	O
on	O
in	O
a	O
manner	O
that	O
allows	O
for	O
efficient	O
generation	O
of	O
completion	O
lists	O
.	O
</s>
<s>
A	O
prefix	O
trie	B-General_Concept
is	O
an	O
ordered	B-Application
tree	I-Application
data	I-Application
structure	I-Application
used	O
in	O
the	O
representation	O
of	O
a	O
set	O
of	O
strings	O
over	O
a	O
finite	O
alphabet	O
set	O
,	O
which	O
allows	O
efficient	O
storage	O
of	O
words	O
with	O
common	O
prefixes	O
.	O
</s>
<s>
Tries	B-General_Concept
can	O
be	O
efficacious	O
on	O
string-searching	B-Algorithm
algorithms	I-Algorithm
such	O
as	O
predictive	B-General_Concept
text	I-General_Concept
,	O
approximate	B-Algorithm
string	I-Algorithm
matching	I-Algorithm
,	O
and	O
spell	B-Application
checking	I-Application
in	O
comparison	O
to	O
a	O
binary	B-Language
search	I-Language
trees	I-Language
.	O
</s>
<s>
A	O
trie	B-General_Concept
can	O
be	O
seen	O
as	O
a	O
tree-shaped	O
deterministic	B-General_Concept
finite	I-General_Concept
automaton	I-General_Concept
.	O
</s>
<s>
Tries	B-General_Concept
support	O
various	O
operations	O
:	O
insertion	O
,	O
deletion	O
,	O
and	O
lookup	O
of	O
a	O
string	O
key	O
.	O
</s>
<s>
Tries	B-General_Concept
are	O
composed	O
of	O
that	O
contain	O
links	O
that	O
are	O
either	O
references	O
to	O
other	O
child	O
suffix	O
child	O
nodes	O
,	O
or	O
.	O
</s>
<s>
Each	O
node	O
contains	O
links	O
,	O
where	O
is	O
the	O
cardinality	B-Application
of	O
the	O
applicable	O
alphabet	O
,	O
although	O
tries	B-General_Concept
have	O
a	O
substantial	O
number	O
of	O
links	O
.	O
</s>
<s>
In	O
most	O
cases	O
,	O
the	O
size	O
of	O
array	O
is	O
bitlength	O
of	O
the	O
character	B-General_Concept
encoding	I-General_Concept
-	O
256	O
in	O
the	O
case	O
of	O
(	O
unsigned	O
)	O
ASCII	B-Protocol
.	O
</s>
<s>
Characters	O
and	O
string	O
keys	O
are	O
implicitly	O
stored	O
in	O
the	O
trie	B-General_Concept
data	B-General_Concept
structure	I-General_Concept
representation	O
,	O
and	O
include	O
a	O
character	O
sentinel	B-Data_Structure
value	I-Data_Structure
indicating	O
string-termination	O
.	O
</s>
<s>
A	O
basic	O
structure	O
type	O
of	O
nodes	O
in	O
the	O
trie	B-General_Concept
is	O
as	O
follows	O
;	O
may	O
contain	O
an	O
optional	O
,	O
which	O
is	O
associated	O
with	O
each	O
key	O
stored	O
in	O
the	O
last	O
character	O
of	O
string	O
,	O
or	O
terminal	O
node	O
.	O
</s>
<s>
Searching	O
a	O
in	O
a	O
trie	B-General_Concept
is	O
guided	O
by	O
the	O
characters	O
in	O
the	O
search	B-Algorithm
string	I-Algorithm
key	O
,	O
as	O
each	O
node	O
in	O
the	O
trie	B-General_Concept
contains	O
a	O
corresponding	O
link	O
to	O
each	O
possible	O
character	O
in	O
the	O
given	O
string	O
.	O
</s>
<s>
Thus	O
,	O
following	O
the	O
string	O
within	O
the	O
trie	B-General_Concept
yields	O
the	O
associated	O
for	O
the	O
given	O
string	O
key	O
.	O
</s>
<s>
Following	O
pseudocode	O
implements	O
the	O
search	O
procedure	O
for	O
a	O
given	O
string	O
key	O
(	O
)	O
in	O
a	O
rooted	O
trie	B-General_Concept
(	O
)	O
.	O
</s>
<s>
In	O
the	O
above	O
pseudocode	O
,	O
and	O
correspond	O
to	O
the	O
pointer	O
of	O
trie	B-General_Concept
's	O
root	B-Application
node	I-Application
and	O
the	O
string	O
key	O
respectively	O
.	O
</s>
<s>
The	O
search	O
operation	O
,	O
in	O
a	O
standard	O
trie	B-General_Concept
,	O
takes	O
,	O
is	O
the	O
size	O
of	O
the	O
string	O
parameter	O
,	O
and	O
corresponds	O
to	O
the	O
alphabet	O
size	O
.	O
</s>
<s>
Binary	B-Language
search	I-Language
trees	I-Language
,	O
on	O
the	O
other	O
hand	O
,	O
take	O
on	O
the	O
worst	O
case	O
,	O
since	O
the	O
search	O
depends	O
on	O
the	O
height	O
of	O
the	O
tree	B-Application
(	O
)	O
of	O
the	O
BST	O
(	O
in	O
case	O
of	O
balanced	B-Data_Structure
trees	I-Data_Structure
)	O
,	O
where	O
and	O
being	O
number	O
of	O
keys	O
and	O
the	O
length	O
of	O
the	O
keys	O
.	O
</s>
<s>
Tries	B-General_Concept
occupy	O
less	O
space	O
in	O
comparison	O
with	O
BST	O
if	O
it	O
encompasses	O
a	O
large	O
number	O
of	O
short	O
strings	O
,	O
since	O
nodes	O
share	O
common	O
initial	O
string	O
subsequences	O
and	O
stores	O
the	O
keys	O
implicitly	O
on	O
the	O
structure	O
.	O
</s>
<s>
The	O
terminal	O
node	O
of	O
the	O
tree	B-Application
contains	O
a	O
non-nil	O
,	O
and	O
it	O
is	O
a	O
search	O
hit	O
if	O
the	O
associated	O
value	O
is	O
found	O
in	O
the	O
trie	B-General_Concept
,	O
and	O
search	O
miss	O
if	O
it	O
is	O
n't	O
.	O
</s>
<s>
Insertion	O
into	O
trie	B-General_Concept
is	O
guided	O
by	O
using	O
the	O
character	B-General_Concept
sets	I-General_Concept
as	O
the	O
indexes	O
into	O
the	O
array	O
until	O
last	O
character	O
of	O
the	O
string	O
key	O
is	O
reached	O
.	O
</s>
<s>
Each	O
node	O
in	O
the	O
trie	B-General_Concept
corresponds	O
to	O
one	O
call	O
of	O
the	O
radix	B-Algorithm
sorting	I-Algorithm
routine	O
,	O
as	O
the	O
trie	B-General_Concept
structure	O
reflects	O
the	O
execution	O
of	O
pattern	O
of	O
the	O
top-down	O
radix	B-Algorithm
sort	I-Algorithm
.	O
</s>
<s>
Deletion	O
of	O
a	O
key	B-Application
–	I-Application
value	I-Application
pair	I-Application
from	O
a	O
trie	B-General_Concept
involves	O
finding	O
the	O
terminal	O
node	O
with	O
the	O
corresponding	O
string	O
key	O
,	O
marking	O
the	O
terminal	O
indicator	O
and	O
value	O
to	O
false	O
and	O
correspondingly	O
.	O
</s>
<s>
Following	O
is	O
a	O
recursive	O
procedure	O
for	O
removing	O
a	O
string	O
key	O
(	O
)	O
from	O
rooted	O
trie	B-General_Concept
(	O
)	O
.	O
</s>
<s>
If	O
terminal	O
and	O
if	O
it	O
has	O
no	O
children	O
,	O
the	O
node	O
gets	O
removed	O
from	O
the	O
trie	B-General_Concept
(	O
line	O
14	O
assign	O
the	O
character	O
index	O
to	O
)	O
.	O
</s>
<s>
However	O
,	O
an	O
end	O
of	O
string	O
key	O
without	O
the	O
node	O
being	O
terminal	O
indicates	O
that	O
the	O
key	O
does	O
not	O
exist	O
,	O
thus	O
the	O
procedure	O
does	O
not	O
modify	O
the	O
trie	B-General_Concept
.	O
</s>
<s>
A	O
trie	B-General_Concept
can	O
be	O
used	O
to	O
replace	O
a	O
hash	B-Algorithm
table	I-Algorithm
,	O
over	O
which	O
it	O
has	O
the	O
following	O
advantages	O
:	O
</s>
<s>
Tries	B-General_Concept
do	O
not	O
need	O
a	O
hash	O
function	O
for	O
the	O
operation	O
,	O
unlike	O
a	O
hash	B-Algorithm
table	I-Algorithm
;	O
there	O
are	O
also	O
no	O
collisions	B-Algorithm
of	O
different	O
keys	O
in	O
a	O
trie	B-General_Concept
.	O
</s>
<s>
Buckets	O
in	O
a	O
trie	B-General_Concept
,	O
which	O
are	O
analogous	O
to	O
hash	B-Algorithm
table	I-Algorithm
buckets	O
that	O
store	O
key	O
collisions	B-Algorithm
,	O
are	O
necessary	O
only	O
if	O
a	O
single	O
key	O
is	O
associated	O
with	O
more	O
than	O
one	O
value	O
.	O
</s>
<s>
String	O
keys	O
within	O
the	O
trie	B-General_Concept
can	O
be	O
sorted	O
using	O
a	O
predetermined	O
alphabetical	O
ordering	O
.	O
</s>
<s>
However	O
,	O
tries	B-General_Concept
are	O
less	O
efficient	O
than	O
a	O
hash	B-Algorithm
table	I-Algorithm
when	O
the	O
data	O
is	O
directly	O
accessed	O
on	O
a	O
secondary	O
storage	O
device	O
such	O
as	O
a	O
hard	O
disk	O
drive	O
that	O
has	O
higher	O
random	B-General_Concept
access	I-General_Concept
time	O
than	O
the	O
main	O
memory	O
.	O
</s>
<s>
Tries	B-General_Concept
are	O
also	O
disadvantageous	O
when	O
the	O
key	B-Application
value	I-Application
cannot	O
be	O
easily	O
represented	O
as	O
string	O
,	O
such	O
as	O
floating	B-Algorithm
point	I-Algorithm
numbers	I-Algorithm
where	O
multiple	O
representations	O
are	O
possible	O
(	O
e.g.	O
</s>
<s>
)	O
,	O
however	O
it	O
can	O
be	O
unambiguously	O
represented	O
as	O
a	O
binary	O
number	O
in	O
IEEE	O
754	O
,	O
in	O
comparison	O
to	O
two	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
format	O
.	O
</s>
<s>
Tries	B-General_Concept
can	O
be	O
represented	O
in	O
several	O
ways	O
,	O
corresponding	O
to	O
different	O
trade-offs	O
between	O
memory	O
use	O
and	O
speed	O
of	O
the	O
operations	O
.	O
</s>
<s>
Using	O
a	O
vector	O
of	O
pointers	O
for	O
representing	O
a	O
trie	B-General_Concept
consumes	O
enormous	O
space	O
;	O
however	O
,	O
memory	O
space	O
can	O
be	O
reduced	O
at	O
the	O
expense	O
of	O
running	O
time	O
if	O
a	O
singly	O
linked	O
list	O
is	O
used	O
for	O
each	O
node	O
vector	O
,	O
as	O
most	O
entries	O
of	O
the	O
vector	O
contains	O
.	O
</s>
<s>
a	O
string	O
of	O
bytes	O
can	O
alternatively	O
be	O
regarded	O
as	O
a	O
string	O
of	O
four-bit	O
units	O
and	O
stored	O
in	O
a	O
trie	B-General_Concept
with	O
sixteen	O
pointers	O
per	O
node	O
.	O
</s>
<s>
Other	O
techniques	O
include	O
storing	O
a	O
vector	O
of	O
256	O
ASCII	B-Protocol
pointers	O
as	O
a	O
bitmap	O
of	O
256	O
bits	O
representing	O
ASCII	B-Protocol
alphabet	O
,	O
which	O
reduces	O
the	O
size	O
of	O
individual	O
nodes	O
dramatically	O
.	O
</s>
<s>
Bitwise	O
tries	B-General_Concept
are	O
used	O
to	O
address	O
the	O
enormous	O
space	O
requirement	O
for	O
the	O
trie	B-General_Concept
nodes	O
in	O
a	O
naive	O
simple	O
pointer	O
vector	O
implementations	O
.	O
</s>
<s>
Each	O
character	O
in	O
the	O
string	O
key	O
set	O
is	O
represented	O
via	O
individual	O
bits	O
,	O
which	O
are	O
used	O
to	O
traverse	O
the	O
trie	B-General_Concept
over	O
a	O
string	O
key	O
.	O
</s>
<s>
The	O
implementations	O
for	O
these	O
types	O
of	O
trie	B-General_Concept
use	O
vectorized	B-Device
CPU	O
instructions	O
to	O
find	B-Algorithm
the	I-Algorithm
first	I-Algorithm
set	I-Algorithm
bit	I-Algorithm
in	O
a	O
fixed-length	O
key	O
input	O
(	O
e.g.	O
</s>
<s>
GCC	B-Application
's	O
__builtin_clz( )	O
intrinsic	B-Application
function	I-Application
)	O
.	O
</s>
<s>
Accordingly	O
,	O
the	O
set	O
bit	O
is	O
used	O
to	O
index	O
the	O
first	O
item	O
,	O
or	O
child	O
node	O
,	O
in	O
the	O
32	O
-	O
or	O
64-entry	O
based	O
bitwise	O
tree	B-Application
.	O
</s>
<s>
This	O
procedure	O
is	O
also	O
cache-local	B-General_Concept
and	O
highly	B-Application
parallelizable	I-Application
due	O
to	O
register	B-General_Concept
independency	O
,	O
and	O
thus	O
performant	O
on	O
out-of-order	B-General_Concept
execution	I-General_Concept
CPUs	O
.	O
</s>
<s>
Radix	B-Data_Structure
tree	I-Data_Structure
,	O
also	O
known	O
as	O
a	O
compressed	O
trie	B-General_Concept
,	O
is	O
a	O
space-optimized	O
variant	O
of	O
a	O
trie	B-General_Concept
in	O
which	O
nodes	O
with	O
only	O
one	O
child	O
get	O
merged	O
with	O
its	O
parents	O
;	O
elimination	O
of	O
branches	O
of	O
the	O
nodes	O
with	O
a	O
single	O
child	O
results	O
in	O
better	O
in	O
both	O
space	O
and	O
time	O
metrics	O
.	O
</s>
<s>
This	O
works	O
best	O
under	O
the	O
following	O
conditions	O
where	O
the	O
trie	B-General_Concept
remains	O
static	O
and	O
set	O
of	O
keys	O
stored	O
are	O
very	O
sparse	O
within	O
their	O
representation	O
space	O
.	O
</s>
<s>
One	O
more	O
approach	O
is	O
to	O
"	O
pack	O
"	O
the	O
trie	B-General_Concept
,	O
in	O
which	O
a	O
space-efficient	O
implementation	O
of	O
a	O
sparse	O
packed	O
trie	B-General_Concept
applied	O
to	O
automatic	O
hyphenation	B-Algorithm
,	O
in	O
which	O
the	O
descendants	O
of	O
each	O
node	O
may	O
be	O
interleaved	O
in	O
memory	O
.	O
</s>
<s>
Patricia	B-Data_Structure
trees	I-Data_Structure
are	O
a	O
particular	O
implementation	O
of	O
compressed	O
binary	O
trie	B-General_Concept
that	O
utilize	O
binary	O
encoding	O
of	O
the	O
string	O
keys	O
in	O
its	O
representation	O
.	O
</s>
<s>
Every	O
node	O
in	O
a	O
Patricia	O
tree	B-Application
contains	O
an	O
index	O
,	O
known	O
as	O
a	O
"	O
skip	O
number	O
"	O
,	O
that	O
stores	O
the	O
node	O
's	O
branching	O
index	O
to	O
avoid	O
empty	O
subtrees	B-Application
during	O
traversal	O
.	O
</s>
<s>
A	O
naive	O
implementation	O
of	O
a	O
trie	B-General_Concept
consumes	O
immense	O
storage	O
due	O
to	O
larger	O
number	O
of	O
leaf-nodes	O
caused	O
by	O
sparse	O
distribution	O
of	O
keys	O
;	O
Patricia	B-Data_Structure
trees	I-Data_Structure
can	O
be	O
efficient	O
for	O
such	O
cases	O
.	O
</s>
<s>
A	O
representation	O
of	O
a	O
Patricia	O
tree	B-Application
with	O
string	O
keys	O
is	O
shown	O
in	O
figure	O
4	O
,	O
and	O
each	O
index	O
value	O
adjacent	O
to	O
the	O
nodes	O
represents	O
the	O
"	O
skip	O
number	O
"	O
-	O
the	O
index	O
of	O
the	O
bit	O
with	O
which	O
branching	O
is	O
to	O
be	O
decided	O
.	O
</s>
<s>
The	O
skip	O
number	O
1	O
at	O
node	O
0	O
corresponds	O
to	O
the	O
position	O
1	O
in	O
the	O
binary	O
encoded	O
ASCII	B-Protocol
where	O
the	O
leftmost	O
bit	O
differed	O
in	O
the	O
key	O
set	O
.	O
</s>
<s>
The	O
skip	O
number	O
is	O
crucial	O
for	O
search	O
,	O
insertion	O
,	O
and	O
deletion	O
of	O
nodes	O
in	O
the	O
Patricia	O
tree	B-Application
,	O
and	O
a	O
bit	O
masking	O
operation	O
is	O
performed	O
during	O
every	O
iteration	O
.	O
</s>
<s>
Trie	B-General_Concept
data	B-General_Concept
structures	I-General_Concept
are	O
commonly	O
used	O
in	O
predictive	B-General_Concept
text	I-General_Concept
or	O
autocomplete	O
dictionaries	O
,	O
and	O
approximate	B-Algorithm
matching	I-Algorithm
algorithms	I-Algorithm
.	O
</s>
<s>
Tries	B-General_Concept
enable	O
faster	O
searches	O
,	O
occupy	O
less	O
space	O
,	O
especially	O
when	O
the	O
set	O
contains	O
large	O
number	O
of	O
short	O
strings	O
,	O
thus	O
used	O
in	O
spell	B-Application
checking	I-Application
,	O
hyphenation	B-Algorithm
applications	O
and	O
longest	B-Protocol
prefix	I-Protocol
match	I-Protocol
algorithms	O
.	O
</s>
<s>
there	O
is	O
no	O
need	O
to	O
store	O
metadata	O
associated	O
with	O
each	O
word	O
)	O
,	O
a	O
minimal	O
deterministic	O
acyclic	O
finite	O
state	O
automaton	O
(	O
DAFSA	O
)	O
or	O
radix	B-Data_Structure
tree	I-Data_Structure
would	O
use	O
less	O
storage	O
space	O
than	O
a	O
trie	B-General_Concept
.	O
</s>
<s>
This	O
is	O
because	O
DAFSAs	O
and	O
radix	B-Data_Structure
trees	I-Data_Structure
can	O
compress	O
identical	O
branches	O
from	O
the	O
trie	B-General_Concept
which	O
correspond	O
to	O
the	O
same	O
suffixes	O
(	O
or	O
parts	O
)	O
of	O
different	O
words	O
being	O
stored	O
.	O
</s>
<s>
String	O
dictionaries	O
are	O
also	O
utilized	O
in	O
natural	B-Language
language	I-Language
processing	I-Language
,	O
such	O
as	O
finding	O
lexicon	B-Application
of	O
a	O
text	O
corpus	O
.	O
</s>
<s>
Lexicographic	O
sorting	O
of	O
a	O
set	O
of	O
string	O
keys	O
can	O
be	O
implemented	O
by	O
building	O
a	O
trie	B-General_Concept
for	O
the	O
given	O
keys	O
and	O
traversing	O
the	O
tree	B-Application
in	O
pre-order	O
fashion	O
;	O
this	O
is	O
also	O
a	O
form	O
of	O
radix	B-Algorithm
sort	I-Algorithm
.	O
</s>
<s>
Tries	B-General_Concept
are	O
also	O
fundamental	O
data	B-General_Concept
structures	I-General_Concept
for	O
burstsort	B-Algorithm
,	O
which	O
is	O
notable	O
for	O
being	O
the	O
fastest	O
string	O
sorting	O
algorithm	O
as	O
of	O
2007	O
,	O
accompanied	O
for	O
its	O
efficient	O
use	O
of	O
CPU	O
cache	B-General_Concept
.	O
</s>
<s>
A	O
special	O
kind	O
of	O
trie	B-General_Concept
,	O
called	O
a	O
suffix	B-Architecture
tree	I-Architecture
,	O
can	O
be	O
used	O
to	O
index	O
all	O
suffixes	O
in	O
a	O
text	O
to	O
carry	O
out	O
fast	O
full-text	O
searches	O
.	O
</s>
<s>
A	O
specialized	O
kind	O
of	O
trie	B-General_Concept
called	O
a	O
compressed	O
trie	B-General_Concept
,	O
is	O
used	O
in	O
web	B-Application
search	I-Application
engines	I-Application
for	O
storing	O
the	O
indexes	O
-	O
a	O
collection	O
of	O
all	O
searchable	B-Application
words	O
.	O
</s>
<s>
The	O
trie	B-General_Concept
is	O
stored	O
in	O
the	O
main	O
memory	O
,	O
whereas	O
the	O
occurrence	O
is	O
kept	O
in	O
an	O
external	O
storage	O
,	O
frequently	O
in	O
large	O
clusters	B-Architecture
,	O
or	O
the	O
in-memory	O
index	O
points	O
to	O
documents	O
stored	O
in	O
an	O
external	O
location	O
.	O
</s>
<s>
Tries	B-General_Concept
are	O
used	O
in	O
Bioinformatics	O
,	O
notably	O
in	O
sequence	B-Algorithm
alignment	I-Algorithm
software	O
applications	O
such	O
as	O
BLAST	O
,	O
which	O
indexes	O
all	O
the	O
different	O
substring	O
of	O
length	O
k	O
(	O
called	O
k-mers	O
)	O
of	O
a	O
text	O
by	O
storing	O
the	O
positions	O
of	O
their	O
occurrences	O
in	O
a	O
compressed	O
trie	B-General_Concept
sequence	O
databases	O
.	O
</s>
<s>
Compressed	O
variants	O
of	O
tries	B-General_Concept
,	O
such	O
as	O
databases	O
for	O
managing	O
Forwarding	B-Protocol
Information	I-Protocol
Base	I-Protocol
(	O
FIB	O
)	O
,	O
are	O
used	O
in	O
storing	O
IP	B-Protocol
address	I-Protocol
prefixes	I-Protocol
within	O
routers	B-Protocol
and	O
bridges	B-Protocol
for	O
prefix-based	O
lookup	O
to	O
resolve	O
mask-based	B-Protocol
operations	O
in	O
IP	B-Protocol
routing	I-Protocol
.	O
</s>
