Thread: longest common substring

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    14

    longest common substring

    Hi.I need an algorithm that finds out the longest substring of 2 strings .
    It's for school project .

  2. #2
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Post your progress.

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    14
    my progress is 60 %
    I tried to do something and partially it works (it finds a substring but not the longest) .
    It's also probably the most uneficient algorithm ever .
    I hoped someone knows a "standard" algorithm , or the location where I can find it in a book , website ,etc...

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    14
    i've fixed the errors but it's still ugly ....
    maybe redesign and a few comments will help

  5. #5
    ~viaxd() viaxd's Avatar
    Join Date
    Aug 2003
    Posts
    246
    classical dynamic programming problem. search google with these terms.
    :wq

  6. #6
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    When they said "post your progress", it didn't mean tell them your estimate of how far along you were in a percentage. It meant post your code if you want some help. But hey, random number progress reports work too.

    This post's progress is roughly 97%, with a 4% margin of error.


    Quzah.
    Hope is the first step on the road to disappointment.

  7. #7
    Registered User
    Join Date
    Jan 2006
    Location
    Europe/Belgrade
    Posts
    78
    Introduction to algorithms, chapter 15.4. The solution is in pseudo code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. longest prefix
    By Marksman in forum C Programming
    Replies: 1
    Last Post: 03-14-2009, 11:19 PM
  2. I need help with creating a substring program
    By CProgramingBegg in forum C Programming
    Replies: 9
    Last Post: 02-06-2009, 09:50 AM
  3. How to handle multiple cases which use common code?
    By tmaxx in forum C Programming
    Replies: 3
    Last Post: 10-03-2008, 07:42 AM
  4. longest common substring problem
    By Enchanter88 in forum C++ Programming
    Replies: 4
    Last Post: 09-29-2007, 11:02 AM
  5. Longest Common Subsequence
    By stimpyzu in forum Tech Board
    Replies: 4
    Last Post: 04-04-2005, 03:18 PM