<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
parallel	B-Operating_System
tree	I-Operating_System
contraction	I-Operating_System
is	O
a	O
broadly	O
applicable	O
technique	O
for	O
the	O
parallel	O
solution	O
of	O
a	O
large	O
number	O
of	O
tree	O
problems	O
,	O
and	O
is	O
used	O
as	O
an	O
algorithm	O
design	O
technique	O
for	O
the	O
design	O
of	O
a	O
large	O
number	O
of	O
parallel	O
graph	O
algorithms	O
.	O
</s>
<s>
Parallel	B-Operating_System
tree	I-Operating_System
contraction	I-Operating_System
was	O
introduced	O
by	O
Gary	O
L	O
.	O
Miller	O
and	O
John	O
H	O
.	O
Reif	O
,	O
and	O
has	O
subsequently	O
been	O
modified	O
to	O
improve	O
efficiency	O
by	O
X	O
.	O
</s>
<s>
Based	O
on	O
the	O
research	O
and	O
work	O
on	O
parallel	B-Operating_System
tree	I-Operating_System
contraction	I-Operating_System
,	O
various	O
algorithms	O
have	O
been	O
proposed	O
targeting	O
to	O
improve	O
the	O
efficiency	O
or	O
simplicity	O
of	O
this	O
topic	O
.	O
</s>
<s>
Over	O
the	O
past	O
several	O
decades	O
there	O
has	O
been	O
significant	O
research	O
on	O
deriving	O
new	O
parallel	B-Operating_System
algorithms	I-Operating_System
for	O
a	O
variety	O
of	O
problems	O
,	O
with	O
the	O
goal	O
of	O
designing	O
highly	O
parallel	O
(	O
polylogarithmic	O
depth	O
)	O
,	O
work-efficient	O
(	O
linear	O
in	O
the	O
sequential	O
running	O
time	O
)	O
algorithms	O
.	O
</s>
<s>
Then	O
based	O
on	O
this	O
generic	O
tree	O
,	O
we	O
can	O
further	O
come	O
up	O
with	O
some	O
special	O
cases	O
:	O
(	O
1	O
)	O
balanced	B-Data_Structure
binary	I-Data_Structure
tree	I-Data_Structure
;	O
(	O
2	O
)	O
linked	B-Data_Structure
list	I-Data_Structure
.	O
</s>
<s>
A	O
balanced	B-Data_Structure
binary	I-Data_Structure
tree	I-Data_Structure
has	O
exactly	O
two	O
branches	O
for	O
each	O
vertex	O
except	O
for	O
leaves	O
.	O
</s>
<s>
A	O
linked	B-Data_Structure
list	I-Data_Structure
is	O
also	O
a	O
tree	O
where	O
every	O
vertex	O
has	O
only	O
one	O
child	O
.	O
</s>
<s>
To	O
address	O
this	O
problem	O
,	O
we	O
make	O
use	O
of	O
an	O
algorithm	O
called	O
prefix	B-Application
sum	I-Application
by	O
using	O
the	O
Euler	B-Operating_System
tour	I-Operating_System
technique	I-Operating_System
.	O
</s>
<s>
With	O
the	O
Euler	B-Operating_System
tour	I-Operating_System
technique	I-Operating_System
,	O
a	O
tree	O
could	O
be	O
represented	O
in	O
a	O
flat	O
style	O
,	O
and	O
thus	O
prefix	B-Application
sum	I-Application
could	O
be	O
applied	O
to	O
an	O
arbitrary	O
tree	O
in	O
this	O
format	O
.	O
</s>
<s>
In	O
fact	O
,	O
prefix	B-Application
sum	I-Application
can	O
be	O
used	O
on	O
any	O
set	O
of	O
values	O
and	O
binary	O
operation	O
which	O
form	O
a	O
group	O
:	O
the	O
binary	O
operation	O
must	O
be	O
associative	O
,	O
every	O
value	O
must	O
have	O
an	O
inverse	O
,	O
and	O
there	O
exists	O
an	O
identity	O
value	O
.	O
</s>
<s>
With	O
a	O
bit	O
of	O
thought	O
,	O
we	O
can	O
find	O
some	O
exceptional	O
cases	O
where	O
prefix	B-Application
sum	I-Application
becomes	O
incapable	O
or	O
inefficient	O
.	O
</s>
<s>
And	O
in	O
order	O
to	O
solve	O
actual	O
problems	O
using	O
tree	B-Operating_System
contraction	I-Operating_System
,	O
the	O
algorithm	O
has	O
a	O
structure	O
:	O
</s>
<s>
In	O
the	O
two	O
“	O
degenerate	O
”	O
cases	O
listed	O
above	O
,	O
the	O
rake	O
is	O
the	O
best	O
tool	O
for	O
dealing	O
with	O
balanced	B-Data_Structure
binary	I-Data_Structure
trees	I-Data_Structure
,	O
and	O
compress	O
is	O
the	O
best	O
for	O
linked	B-Data_Structure
lists	I-Data_Structure
.	O
</s>
<s>
Now	O
rephrase	O
the	O
tree	B-Operating_System
contraction	I-Operating_System
algorithm	O
as	O
follows	O
:	O
</s>
<s>
To	O
evaluate	O
an	O
expression	O
given	O
as	O
a	O
binary	O
tree	O
(	O
this	O
problem	O
also	O
known	O
as	O
binary	B-Algorithm
expression	I-Algorithm
tree	I-Algorithm
)	O
,	O
consider	O
that	O
:	O
</s>
<s>
We	O
now	O
show	O
the	O
evaluation	O
can	O
be	O
done	O
with	O
parallel	B-Operating_System
tree	I-Operating_System
contraction	I-Operating_System
.	O
</s>
