How about concentating all your strings into a single long string and
then constructing a suffix tree?
The strings will be seperated using a special character that does not
belong to any of them (let's say that they will be null seperated).
Using this suffix tree to find the longest common sub-wor
Did you detect the exact element that points backwards, or you just
know that there is a cycle somewhere in the list?
(There is a simple and efficient algorithm to know that there is a
cycle without detecting the exact element that points backwards)
--~--~-~--~~~---~-