Interview question - any suggestions

Discussion in 'C Programming' started by denis_browne@hotmail.com, Mar 3, 2006.

  1. Guest

    Hi there,
    I got a tough interview questions lately, and I would like to hear
    your opinion:

    An array of N chars is given
    Write an efficient algorithm to find all the repeating substring with a

    minimal size
    of 2

    f.e

    ABCFABHYIFAB


    sunstrings are:


    "AB"
    "FAB"


    Any suggestions?
     
    , Mar 3, 2006
    #1
    1. Advertising

  2. wrote:
    > Hi there,
    > I got a tough interview questions lately, and I would like to hear
    > your opinion:
    >
    > An array of N chars is given
    > Write an efficient algorithm to find all the repeating substring with a
    >
    > minimal size
    > of 2
    >
    > f.e
    >
    > ABCFABHYIFAB
    >
    > sunstrings are:
    >
    > "AB"
    > "FAB"
    >
    > Any suggestions?


    Giving it a go? And then asking here about specific problems?

    BTW, the way you state it, this is a question for comp.programming as I
    don't see any reference to C.
     
    Vladimir S. Oka, Mar 3, 2006
    #2
    1. Advertising

  3. Robin Haigh Guest

    <> wrote in message
    news:...
    > Hi there,
    > I got a tough interview questions lately, and I would like to hear
    > your opinion:
    >
    > An array of N chars is given
    > Write an efficient algorithm to find all the repeating substring with a
    >
    > minimal size
    > of 2
    >
    > f.e
    >
    > ABCFABHYIFAB
    >
    >
    > sunstrings are:
    >
    >
    > "AB"
    > "FAB"
    >
    >
    > Any suggestions?
    >


    FA is repeated as well. AB is different, because there's an additional AB
    besides the ones that are part of FAB. These things tend to depend a lot on
    the precise problem definition: clarification needed...

    --
    RSH
     
    Robin Haigh, Mar 3, 2006
    #3
  4. Robin Haigh Guest

    "Robin Haigh" <> wrote in message
    news:du9b7h$auf$...
    >
    > <> wrote in message
    > news:...
    > > Hi there,
    > > I got a tough interview questions lately, and I would like to hear
    > > your opinion:
    > >
    > > An array of N chars is given
    > > Write an efficient algorithm to find all the repeating substring with a
    > >
    > > minimal size
    > > of 2
    > >
    > > f.e
    > >
    > > ABCFABHYIFAB
    > >
    > >
    > > sunstrings are:
    > >
    > >
    > > "AB"
    > > "FAB"
    > >
    > >
    > > Any suggestions?
    > >

    >
    > FA is repeated as well. AB is different, because there's an additional AB
    > besides the ones that are part of FAB. These things tend to depend a lot

    on
    > the precise problem definition: clarification needed...



    I should also have asked about self-overlapping repeats -- does AAA contain
    two instances of AA?

    --
    RSH


    >
     
    Robin Haigh, Mar 3, 2006
    #4
  5. Guest

    Hai friend,
    You can always refer to any algorithm books like Computer Algorithms by
    Sara Base for any doubts regarding algorithms. I think the answer for
    your question is definetly found under the topic String
    Matching/Seraching.
     
    , Mar 3, 2006
    #5
  6. wrote:
    > Hai friend,
    > You can always refer to any algorithm books like Computer Algorithms by
    > Sara Base for any doubts regarding algorithms. I think the answer for
    > your question is definetly found under the topic String
    > Matching/Seraching.


    Please quote what and who you're replying to. Lurk a while in here
    before posting.
     
    Vladimir S. Oka, Mar 3, 2006
    #6
  7. writes:
    > You can always refer to any algorithm books like Computer Algorithms by
    > Sara Base for any doubts regarding algorithms. I think the answer for
    > your question is definetly found under the topic String
    > Matching/Seraching.


    Please read <http://cfaj.freeshell.org/google/>.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Mar 3, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Hampson
    Replies:
    4
    Views:
    466
    Brian Hampson
    Apr 7, 2004
  2. Glenn
    Replies:
    8
    Views:
    403
    Chuck Ritzke
    Apr 24, 2004
  3. Dave Smithz
    Replies:
    4
    Views:
    986
    Dave Smithz
    Oct 26, 2004
  4. sandeep
    Replies:
    11
    Views:
    735
    jmcgill
    Sep 28, 2006
  5. reema
    Replies:
    0
    Views:
    294
    reema
    Aug 26, 2008
Loading...

Share This Page