title: breadth first traversal directed vs undirected graph
body: <p>how does bfs on directed and undirected graph differ in implementation.</p>
  
  <p>i found the following pseudocode on web. i am ok with undirected graph. but can't figure out how to implement it for directed graph.</p>
  
  <pre><code> frontier = new Queue()
    mark root visited (set root.distance = 0)
    frontier.push(root)
    while frontier not empty {
       Vertex v = frontier.pop()
      for each successor v' of v {
      if v' unvisited {
          frontier.push(v')
          mark v' visited (v'.distance = v.distance + 1)
      }
      }
    }
  </code></pre>