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.