How a Depth First Search traverse an Unconnected Graph

0 kishor joshi · February 23, 2015
I have a question that I know how depth first search work in connected undirected graph.It Places all nodes in stack.But I want to know how this will work on a Unconnected graph.

Any Link or explanation is apperciate..


Post a Reply


Oldest  Newest  Rating
0 kishor joshi · February 23, 2015
@c Student:Thanks
0 c student · February 23, 2015
well, if it's unconnected, i'm assuming you'd start off with the lowest vertex id and from there, link the connected ones if there are any, then move onto the next lowest vertex id of the other unconnected graphs.  at least that's how i'd do it.  or you could maybe try using different stacks for each sub graph if you're using more than one stack?
  • 1

Other Computer Related


Anything else technology related including search engines, social networking, marketing, and more!

Bucky Roberts Administrator