Interview question - any suggestions

D

denis_browne

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?
 
V

Vladimir S. Oka

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.
 
R

Robin Haigh

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...
 
R

Robin Haigh

Robin Haigh said:
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?
[/QUOTE]
 
S

selvinmani

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.
 
V

Vladimir S. Oka

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top