<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
finger	B-Algorithm
search	I-Algorithm
on	O
a	O
data	B-General_Concept
structure	I-General_Concept
is	O
an	O
extension	O
of	O
any	O
search	O
operation	O
that	O
structure	O
supports	O
,	O
where	O
a	O
reference	O
(	O
finger	O
)	O
to	O
an	O
element	O
in	O
the	O
data	B-General_Concept
structure	I-General_Concept
is	O
given	O
along	O
with	O
the	O
query	O
.	O
</s>
<s>
While	O
the	O
search	O
time	O
for	O
an	O
element	O
is	O
most	O
frequently	O
expressed	O
as	O
a	O
function	O
of	O
the	O
number	O
of	O
elements	O
in	O
a	O
data	B-General_Concept
structure	I-General_Concept
,	O
finger	B-Algorithm
search	I-Algorithm
times	O
are	O
a	O
function	O
of	O
the	O
distance	O
between	O
the	O
element	O
and	O
the	O
finger	O
.	O
</s>
<s>
If	O
a	O
normal	O
search	O
in	O
some	O
structure	O
would	O
normally	O
take	O
O(f(n )	O
)	O
time	O
,	O
then	O
a	O
finger	B-Algorithm
search	I-Algorithm
for	O
x	O
with	O
finger	O
y	O
should	O
ideally	O
take	O
O(f(d )	O
)	O
time	O
.	O
</s>
<s>
Remark	O
that	O
since	O
d	O
≤	O
n	O
,	O
it	O
follows	O
that	O
in	O
the	O
worst	O
case	O
,	O
finger	B-Algorithm
search	I-Algorithm
is	O
only	O
as	O
bad	O
as	O
normal	O
search	O
.	O
</s>
<s>
However	O
,	O
in	O
practice	O
these	O
degenerate	O
finger	B-Algorithm
searches	I-Algorithm
do	O
more	O
work	O
than	O
normal	O
searches	O
.	O
</s>
<s>
For	O
instance	O
,	O
if	O
f(n )	O
is	O
log(n )	O
,	O
and	O
finger	B-Algorithm
search	I-Algorithm
does	O
twice	O
as	O
many	O
comparisons	O
as	O
normal	O
search	O
in	O
the	O
worst	O
case	O
,	O
it	O
follows	O
that	O
finger	B-Algorithm
search	I-Algorithm
is	O
slower	O
when	O
d	O
>	O
.	O
</s>
<s>
Therefore	O
,	O
finger	B-Algorithm
search	I-Algorithm
should	O
only	O
be	O
used	O
when	O
one	O
can	O
reasonably	O
expect	O
the	O
target	O
to	O
actually	O
be	O
close	O
to	O
the	O
finger	O
.	O
</s>
<s>
Some	O
popular	O
data	B-General_Concept
structures	I-General_Concept
support	O
finger	B-Algorithm
search	I-Algorithm
with	O
no	O
additional	O
changes	O
to	O
the	O
actual	O
structure	O
.	O
</s>
<s>
In	O
structures	O
where	O
searching	O
for	O
an	O
element	O
x	O
is	O
accomplished	O
by	O
narrowing	O
down	O
an	O
interval	O
over	O
which	O
x	O
can	O
be	O
found	O
,	O
finger	B-Algorithm
search	I-Algorithm
from	O
y	O
is	O
typically	O
accomplished	O
by	O
reversing	O
the	O
search	O
process	O
from	O
y	O
until	O
the	O
search	O
interval	O
is	O
large	O
enough	O
to	O
contain	O
x	O
,	O
at	O
which	O
point	O
search	O
proceeds	O
as	O
normal	O
.	O
</s>
<s>
In	O
a	O
linked	B-Data_Structure
list	I-Data_Structure
,	O
one	O
normally	O
searches	O
linearly	O
for	O
an	O
element	O
by	O
walking	O
from	O
one	O
end	O
to	O
the	O
other	O
.	O
</s>
<s>
If	O
the	O
linked	B-Data_Structure
list	I-Data_Structure
is	O
sorted	O
,	O
and	O
we	O
have	O
a	O
reference	O
to	O
some	O
node	O
containing	O
y	O
,	O
then	O
we	O
may	O
find	O
x	O
in	O
O(d )	O
time	O
by	O
starting	O
our	O
search	O
from	O
y	O
.	O
</s>
<s>
In	O
a	O
sorted	B-Data_Structure
array	I-Data_Structure
A	O
,	O
one	O
normally	O
searches	O
for	O
an	O
element	O
x	O
in	O
A	O
with	O
a	O
binary	O
search	O
.	O
</s>
<s>
Finger	B-Algorithm
search	I-Algorithm
is	O
accomplished	O
by	O
performing	O
a	O
one-sided	O
search	O
from	O
A[j]	O
=	O
y	O
.	O
</s>
<s>
Therefore	O
,	O
finger	B-Algorithm
search	I-Algorithm
for	O
x	O
from	O
y	O
takes	O
O(k )	O
=	O
O(log d )	O
time	O
.	O
</s>
<s>
In	O
a	O
skip	O
list	O
,	O
one	O
can	O
finger	B-Algorithm
search	I-Algorithm
for	O
x	O
from	O
a	O
node	O
containing	O
the	O
element	O
y	O
by	O
simply	O
continuing	O
the	O
search	O
from	O
this	O
point	O
.	O
</s>
<s>
A	O
treap	B-Application
is	O
a	O
randomized	B-Application
binary	I-Application
search	I-Application
tree	I-Application
(	O
BST	O
)	O
.	O
</s>
<s>
Searching	O
in	O
a	O
treap	B-Application
is	O
the	O
same	O
as	O
searching	O
for	O
an	O
element	O
in	O
any	O
other	O
BST	O
.	O
</s>
<s>
Treaps	B-Application
however	O
have	O
the	O
property	O
that	O
the	O
expected	O
path	O
length	O
between	O
two	O
elements	O
of	O
distance	O
d	O
is	O
O(log d )	O
.	O
</s>
<s>
Thus	O
,	O
to	O
finger	B-Algorithm
search	I-Algorithm
from	O
the	O
node	O
containing	O
y	O
for	O
x	O
,	O
one	O
can	O
climb	O
the	O
tree	O
from	O
y	O
until	O
an	O
ancestor	O
of	O
x	O
is	O
found	O
,	O
at	O
which	O
point	O
normal	O
BST	O
search	O
proceeds	O
as	O
usual	O
.	O
</s>
<s>
While	O
determining	O
if	O
a	O
node	O
is	O
the	O
ancestor	O
of	O
another	O
is	O
non-trivial	O
,	O
one	O
may	O
augment	O
the	O
tree	O
to	O
support	O
queries	O
of	O
this	O
form	O
to	O
give	O
expected	O
O(log d )	O
finger	B-Algorithm
search	I-Algorithm
time	O
.	O
</s>
<s>
Implementations	O
of	O
the	O
rope	O
(	O
data	B-General_Concept
structure	I-General_Concept
)	O
typically	O
implement	O
a	O
cord	O
position	O
iterator	O
to	O
traverse	O
the	O
string	O
.	O
</s>
<s>
Like	O
most	O
balanced	O
trees	O
,	O
ropes	B-Data_Structure
require	O
O(log(n )	O
)	O
time	O
to	O
retrieve	O
data	O
in	O
one	O
leaf	O
of	O
the	O
tree	O
when	O
given	O
only	O
the	O
root	O
of	O
the	O
tree	O
.	O
</s>
<s>
Implementations	O
of	O
ropes	B-Data_Structure
typically	O
cache	O
"	O
extra	O
information	O
"	O
about	O
the	O
entire	O
the	O
path	O
from	O
the	O
root	O
to	O
the	O
current	O
node	O
position	O
in	O
the	O
iterator	O
.	O
</s>
<s>
Other	O
implementations	O
of	O
tree	O
data	B-General_Concept
structures	I-General_Concept
sometimes	O
store	O
"	O
extra	O
information	O
"	O
in	O
the	O
tree	O
itself	O
,	O
</s>
<s>
If	O
one	O
can	O
perform	O
finger	B-Algorithm
search	I-Algorithm
in	O
an	O
iterative	O
manner	O
in	O
O(f(d )	O
)	O
time	O
,	O
where	O
each	O
iteration	O
takes	O
O(1 )	O
time	O
,	O
then	O
by	O
providing	O
c	O
different	O
fingers	O
,	O
one	O
can	O
perform	O
finger	B-Algorithm
search	I-Algorithm
in	O
O( c	O
min{	O
d(x, y1 )	O
,	O
...	O
,	O
d(x, yc )	O
}	O
)	O
time	O
.	O
</s>
<s>
This	O
is	O
accomplished	O
by	O
starting	O
finger	B-Algorithm
search	I-Algorithm
for	O
all	O
c	O
fingers	O
,	O
and	O
iterating	O
them	O
forward	O
one	O
step	O
each	O
until	O
the	O
first	O
one	O
terminates	O
.	O
</s>
<s>
Splay	B-Data_Structure
trees	I-Data_Structure
have	O
this	O
property	O
for	O
any	O
choice	O
of	O
f	O
with	O
no	O
additional	O
processing	O
on	O
sufficiently	O
large	O
sequences	O
of	O
accesses	O
.	O
</s>
<s>
Finger	B-Algorithm
search	I-Algorithm
can	O
be	O
used	O
to	O
re-use	O
work	O
already	O
done	O
in	O
previous	O
searches	O
.	O
</s>
<s>
For	O
instance	O
,	O
one	O
way	O
to	O
iterate	O
over	O
the	O
elements	O
in	O
a	O
data	B-General_Concept
structure	I-General_Concept
is	O
to	O
simply	O
finger	B-Algorithm
search	I-Algorithm
for	O
them	O
in	O
order	O
,	O
where	O
the	O
finger	O
for	O
one	O
query	O
is	O
the	O
location	O
of	O
the	O
result	O
of	O
the	O
last	O
.	O
</s>
<s>
One	O
may	O
optimize	O
their	O
data	B-General_Concept
structure	I-General_Concept
by	O
doing	O
this	O
internally	O
if	O
it	O
is	O
known	O
that	O
searches	O
are	O
frequently	O
near	O
the	O
last	O
search	O
.	O
</s>
<s>
A	O
finger	B-Algorithm
search	I-Algorithm
tree	I-Algorithm
is	O
a	O
type	O
of	O
data	B-General_Concept
structure	I-General_Concept
that	O
allows	O
fingers	O
to	O
be	O
specified	O
such	O
that	O
all	O
or	O
some	O
of	O
their	O
supported	O
operations	O
are	O
faster	O
when	O
they	O
access	O
or	O
modify	O
a	O
location	O
near	O
a	O
finger	O
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
finger	B-Algorithm
searches	I-Algorithm
described	O
in	O
this	O
article	O
,	O
these	O
fingers	O
are	O
not	O
provided	O
at	O
query	O
time	O
,	O
but	O
are	O
separately	O
specified	O
so	O
that	O
all	O
future	O
operations	O
use	O
these	O
fingers	O
.	O
</s>
