Re: divide & conquer algorithm to implement string matching



On 31 Mag, 02:46, Pascal Bourguignon <p...@xxxxxxxxxxxxxxxxx> wrote:
misterio <giagim...@xxxxxxxxx> writes:
On 30 Mag, 14:43, Pascal Bourguignon <p...@xxxxxxxxxxxxxxxxx> wrote:
It's called "divide and conquer", not "divide by 2 and conquer".
I know that,I choose 2 just because it's the simplest one.Do you mean
that It could be better if I choose another one?

Yes, you could choose 1 and n-1. It works as well, and can easily be
converted into an iteration instead of a recursion.
Maybe you missed the point here,that is I don't use recursion and d&c
here because It's really useful,I use it just to apply this technique
to this problem.It's an exercise,not producion code.If I wanted a good
algorithm,I'd have chosen KMP.

.