i guess they were talking abt spanning tree , so you can use prism or kruskal algo to do the same.
On Mon, Mar 12, 2012 at 3:05 PM, Umer Farooq <the.um...@gmail.com> wrote: > Hello friends, > > I recently had an onsite MS interview. One of the questions that they > asked was: > > > - Given a directed graph, write a program that takes root of the graph > and returns root of a tree which comprises of all the nodes of the graph in > the same way as they appeared in the graph (the graph contains no cycles). > > > -- > Umer > > -- > 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. > -- 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.