<s>
In	O
computational	O
geometry	O
,	O
the	O
gift	B-Algorithm
wrapping	I-Algorithm
algorithm	I-Algorithm
is	O
an	O
algorithm	O
for	O
computing	O
the	O
convex	O
hull	O
of	O
a	O
given	O
set	O
of	O
points	O
.	O
</s>
<s>
In	O
the	O
two-dimensional	O
case	O
the	O
algorithm	O
is	O
also	O
known	O
as	O
Jarvis	B-Algorithm
march	I-Algorithm
,	O
after	O
R	O
.	O
A	O
.	O
Jarvis	O
,	O
who	O
published	O
it	O
in	O
1973	O
;	O
it	O
has	O
O(nh )	O
time	O
complexity	O
,	O
where	O
n	O
is	O
the	O
number	O
of	O
points	O
and	O
h	O
is	O
the	O
number	O
of	O
points	O
on	O
the	O
convex	O
hull	O
.	O
</s>
<s>
Its	O
real-life	O
performance	O
compared	O
with	O
other	O
convex	B-Algorithm
hull	I-Algorithm
algorithms	I-Algorithm
is	O
favorable	O
when	O
n	O
is	O
small	O
or	O
h	O
is	O
expected	O
to	O
be	O
very	O
small	O
with	O
respect	O
to	O
n	O
.	O
In	O
general	O
cases	O
,	O
the	O
algorithm	O
is	O
outperformed	O
by	O
many	O
others	O
(	O
See	O
Convex	B-Algorithm
hull	I-Algorithm
algorithms	I-Algorithm
)	O
.	O
</s>
<s>
Also	O
,	O
the	O
complete	O
implementation	O
must	O
deal	O
with	O
degenerate	O
cases	O
when	O
the	O
convex	O
hull	O
has	O
only	O
1	O
or	O
2	O
vertices	O
,	O
as	O
well	O
as	O
with	O
the	O
issues	O
of	O
limited	O
arithmetic	B-Architecture
precision	I-Architecture
,	O
both	O
of	O
computer	O
computations	O
and	O
input	O
data	O
.	O
</s>
<s>
The	O
gift	B-Algorithm
wrapping	I-Algorithm
algorithm	I-Algorithm
begins	O
with	O
i	O
=	O
0	O
and	O
a	O
point	O
p0	O
known	O
to	O
be	O
on	O
the	O
convex	O
hull	O
,	O
e.g.	O
,	O
the	O
leftmost	O
point	O
,	O
and	O
selects	O
the	O
point	O
pi+1	O
such	O
that	O
all	O
points	O
are	O
to	O
the	O
right	O
of	O
the	O
line	O
pi	O
pi+1	O
.	O
</s>
<s>
In	O
two	O
dimensions	O
,	O
the	O
gift	B-Algorithm
wrapping	I-Algorithm
algorithm	I-Algorithm
is	O
similar	O
to	O
the	O
process	O
of	O
winding	O
a	O
string	O
(	O
or	O
wrapping	O
paper	O
)	O
around	O
the	O
set	O
of	O
points	O
.	O
</s>
<s>
The	O
run	O
time	O
depends	O
on	O
the	O
size	O
of	O
the	O
output	O
,	O
so	O
Jarvis	B-Algorithm
's	I-Algorithm
march	I-Algorithm
is	O
an	O
output-sensitive	B-Language
algorithm	I-Language
.	O
</s>
<s>
However	O
,	O
because	O
the	O
running	O
time	O
depends	O
linearly	O
on	O
the	O
number	O
of	O
hull	O
vertices	O
,	O
it	O
is	O
only	O
faster	O
than	O
algorithms	O
such	O
as	O
Graham	B-Algorithm
scan	I-Algorithm
when	O
the	O
number	O
h	O
of	O
hull	O
vertices	O
is	O
smaller	O
than	O
logn	O
.	O
</s>
<s>
Chan	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
another	O
convex	B-Algorithm
hull	I-Algorithm
algorithm	I-Algorithm
,	O
combines	O
the	O
logarithmic	O
dependence	O
of	O
Graham	B-Algorithm
scan	I-Algorithm
with	O
the	O
output	B-Language
sensitivity	I-Language
of	O
the	O
gift	B-Algorithm
wrapping	I-Algorithm
algorithm	I-Algorithm
,	O
achieving	O
an	O
asymptotic	O
running	O
time	O
that	O
improves	O
on	O
both	O
Graham	B-Algorithm
scan	I-Algorithm
and	O
gift	O
wrapping	O
.	O
</s>
