One (space-intensive) idea: Re-represent each string as a set of pairs (character, position of character). Then sort each set of pairs by character. Then find corresponding sequences in the sorted lists of pairs, where the character and the difference between position is the same from pair to pair in the sequence. Then narrow down the sequences to those that actually are substrings of adjacent characters and choose the longest.
On May 8, 5:00 am, Jitendra Kushwaha <[email protected]> wrote: > Find the longest common subsequence of given N strings each having > length between 0 to M. > Can anybody give a good approach to the solutions -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
