For other algorithms have a look here, http://en.wikipedia.org/wiki/Longest_common_substring_problem
On Aug 6, 1:55 pm, payel roy <smithpa...@gmail.com> wrote: > Trie .. > > On 6 August 2011 14:24, Mukul Gupta <mukul.gupta...@gmail.com> wrote: > > > > > > > > > Yes, vikash is right. This will work. Works in O(nm). > > >http://ideone.com/G6RAK > > > On Sat, Aug 6, 2011 at 1:30 PM, vikash <vikash.ckiiit...@gmail.com> wrote: > > >> apply longest common subsequqnce problem with a little modification. > >> that would solve your problem. > > >> On Aug 6, 12:54 pm, swetha rahul <swetharahu...@gmail.com> wrote: > >> > Hi, > >> > How to find the longest matching substring in 2 arrays.. > > >> > Say we have 2 strings, > >> > str1="abcdefghi" and str2="iabcdefgk" the answer must be "abcdefg" > > >> -- > >> 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. -- 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.