@Raghavan if you want to fing the shortest path from a node u to v then its better to use BFS but according to your second post it seems you want to find path from root node to a leaf, in that case DFS seems to be best
On Wed, Jun 15, 2011 at 9:56 PM, bittu <shashank7andr...@gmail.com> wrote: > I think BFS will do That isn't it.?? lets say we have starting node > v & wants to find shortest path e.g leaf at lowest height say this > node u so when you will do BFS each level will represent the shortest > path between two nodes. shortest path=min dist(V,U) > > DS Used Queue > Time Complexity O(N) > > > Correct me if anything wrong > > > Shashank > Computer Science > CSE,BIT Mesra > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.