I am thinking on the lines of using two pointer strategy. Something similar we use to detect loop in a link list. If graph is implemented using linked list we can have two pointers both moving at different speeds while traversing a graph and compare them. If they are equal we have a loop in graph. This is a very high level idea. I need to think more if it can actually work.
Any inputs ? Tejas Kokje --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---