wu :: forums
« wu :: forums - Longest repeated String in two strings »

Welcome, Guest. Please Login or Register.
Nov 29th, 2024, 1:11am

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: Eigenray, Icarus, william wu, towr, SMQ, Grimbal, ThudnBlunder)
   Longest repeated String in two strings
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Longest repeated String in two strings  (Read 720 times)
downloadprj
Newbie
*





   


Posts: 4
Longest repeated String in two strings  
« on: Nov 24th, 2007, 7:18am »
Quote Quote Modify Modify

Find the longest repeated string in two strings.
It has to be a contiguous string in both.
e.g.
str1 = "bdhalgorithmseh"
str2 = "sdalgorithmqgf"
 
Result = "algorithm"
« Last Edit: Nov 24th, 2007, 7:19am by downloadprj » IP Logged
KWillets
Junior Member
**





   


Posts: 84
Re: Longest repeated String in two strings  
« Reply #1 on: Nov 26th, 2007, 11:10am »
Quote Quote Modify Modify

http://en.wikipedia.org/wiki/Longest_common_substring
IP Logged
johny_cage
Full Member
***





   


Gender: male
Posts: 155
Re: Longest repeated String in two strings  
« Reply #2 on: Nov 27th, 2007, 7:03am »
Quote Quote Modify Modify

@Link above
 
Can anybody please elaborate, that how the suffix tree leaves are having the values (x:y). It is confusing....
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Longest repeated String in two strings  
« Reply #3 on: Nov 27th, 2007, 7:10am »
Quote Quote Modify Modify

I think in x:y x represent the id# of the string, and y the position in that string where the match starts.
So e.g. in that diagram, "A$" occurs at position 3 of strings 1 (BABA) and 2 (ABBA)
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
johny_cage
Full Member
***





   


Gender: male
Posts: 155
Re: Longest repeated String in two strings  
« Reply #4 on: Nov 27th, 2007, 11:22am »
Quote Quote Modify Modify

@Towr
yes u r right... Cheesy
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board