<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
Kosaraju-Sharir	O
'	O
s	O
algorithm	O
(	O
also	O
known	O
as	O
Kosaraju	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
)	O
is	O
a	O
linear	O
time	O
algorithm	O
to	O
find	O
the	O
strongly	O
connected	O
components	O
of	O
a	O
directed	O
graph	O
.	O
</s>
<s>
If	O
strong	O
components	O
are	O
to	O
be	O
represented	O
by	O
appointing	O
a	O
separate	O
root	O
vertex	O
for	O
each	O
component	O
,	O
and	O
assigning	O
to	O
each	O
vertex	O
the	O
root	O
vertex	O
of	O
its	O
component	O
,	O
then	O
Kosaraju	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
can	O
be	O
stated	O
as	O
follows	O
.	O
</s>
<s>
As	O
given	O
above	O
,	O
the	O
algorithm	O
for	O
simplicity	O
employs	O
depth-first	B-Algorithm
search	I-Algorithm
,	O
but	O
it	O
could	O
just	O
as	O
well	O
use	O
breadth-first	B-Algorithm
search	I-Algorithm
as	O
long	O
as	O
the	O
post-order	O
property	O
is	O
preserved	O
.	O
</s>
<s>
Provided	O
the	O
graph	O
is	O
described	O
using	O
an	O
adjacency	B-Data_Structure
list	I-Data_Structure
,	O
Kosaraju	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
performs	O
two	O
complete	O
traversals	O
of	O
the	O
graph	O
and	O
so	O
runs	O
in	O
Θ( V+E	O
)	O
(	O
linear	O
)	O
time	O
,	O
which	O
is	O
asymptotically	B-General_Concept
optimal	I-General_Concept
because	O
there	O
is	O
a	O
matching	O
lower	O
bound	O
(	O
any	O
algorithm	O
must	O
examine	O
all	O
vertices	O
and	O
edges	O
)	O
.	O
</s>
<s>
It	O
is	O
the	O
conceptually	O
simplest	O
efficient	O
algorithm	O
,	O
but	O
is	O
not	O
as	O
efficient	O
in	O
practice	O
as	O
Tarjan	B-Algorithm
's	I-Algorithm
strongly	I-Algorithm
connected	I-Algorithm
components	I-Algorithm
algorithm	I-Algorithm
and	O
the	O
path-based	B-Algorithm
strong	I-Algorithm
component	I-Algorithm
algorithm	I-Algorithm
,	O
which	O
perform	O
only	O
one	O
traversal	O
of	O
the	O
graph	O
.	O
</s>
<s>
If	O
the	O
graph	O
is	O
represented	O
as	O
an	O
adjacency	B-Algorithm
matrix	I-Algorithm
,	O
the	O
algorithm	O
requires	O
Ο(V2 )	O
time	O
.	O
</s>
