title: Draw the depth first search tree
body: <p>I am trying to solve some problems from some paper exams and I have this problem:</p>
  
  <blockquote>
    <p>Consider the graph G = (N,A) where N={a,b,c,d,e,f,g,h} and A is  the
    following set of arcs:
    {(0,5),(5,4),(4,5),(4,1),(1,2),(2,3),(3,4),(4,3),(0,6),(6,7)} and I
    have to draw the depth-first search tree T for G with the root being 0</p>
  </blockquote>
  
  <p>This is the graph: </p>
  
  <p><img src="https://i.stack.imgur.com/7XQzF.png" alt="enter image description here"></p>
  
  <p>I got the following tree:</p>
  
  <p><img src="https://i.stack.imgur.com/0mwyP.png" alt="enter image description here"></p>
  
  <p>and the answer is this one:</p>
  
  <p><img src="https://i.stack.imgur.com/FfzyN.png" alt="enter image description here"></p>
  
  <p>(for both cases above, please ignore the arrows)
  and I don't understand why. Anyone who can explain me what I'm doing wrong?
  Thanks!</p>