Question: DFS ( G ) for each vertex } u inG . u . color = WHITE u . pi = NIL time =
DFSG
for each vertex uinG
ucolor WHITE
upi NIL
time
for each vertex uinG
if ucolor WHITE
DFSVisitGu
DFSVISIT Gu
mathrm time time
ud time
ucolor GRAY
for each vinGAdju
if vcolor WHITE
vpi u
DFSVISIT Gv
ucolor BLACK
time time
uf time
prove the correctness of the depth first search, use loop invariant to prove it mathematically, don't involve the discovery and finishing time. prove it without discovery, and finishing time
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
