-2
$\begingroup$

Which of the choices displayed is not a possible order in which Depth-First search could mark the vertices of the graph displayed as visited ?

enter image description here

$\endgroup$
  • $\begingroup$ What did you try? Where did you get stuck? We're happy to help you understand the concepts but just solving exercises for you is unlikely to achieve that. $\endgroup$ – D.W. Oct 10 '16 at 18:57
2
$\begingroup$

This looks like a homework problem to me. Anyways, the answer would be (D), as vertex 'c' has to be visited before vertex 'b' This is because while recursing, when the root is set to be vertex 'd' all of its children ('c') have to be visited before we can visit the next child ('b') of the parent node ('a').

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.