Re: divide & conquer algorithm to implement string matching
- From: misterio <giagimari@xxxxxxxxx>
- Date: 31 May 2007 05:21:35 -0700
On 30 Mag, 21:42, Willem <wil...@xxxxxxxx> wrote:
Probably. If the length of the pattern is constant, then the mostIf you look closely at the message that you commented I've said
straightforward iterative solution is also O(n).
What would be more interesting is the time complexity as a function of both
the string length and the pattern length. Say, if the string length is n,
and the pattern length is m. Then the most basic algo would be O(n*m).
I'm guessing the D&C algorithm would be O(n*m) also ?
P.S.: It would actually be more like O((n-m+1)*m) but I'm not sure how
big-oh notation works with multiple variables.
exactly that!I said that in the worst case,ie when m = 1/2n,this
algorithm is O(n^2).
.
- References:
- divide & conquer algorithm to implement string matching
- From: misterio
- Re: divide & conquer algorithm to implement string matching
- From: Logan Shaw
- Re: divide & conquer algorithm to implement string matching
- From: misterio
- Re: divide & conquer algorithm to implement string matching
- From: misterio
- Re: divide & conquer algorithm to implement string matching
- From: misterio
- Re: divide & conquer algorithm to implement string matching
- From: misterio
- Re: divide & conquer algorithm to implement string matching
- From: misterio
- Re: divide & conquer algorithm to implement string matching
- From: misterio
- Re: divide & conquer algorithm to implement string matching
- From: Willem
- divide & conquer algorithm to implement string matching
- Prev by Date: Re: problem on medians
- Next by Date: Re: divide & conquer algorithm to implement string matching
- Previous by thread: Re: divide & conquer algorithm to implement string matching
- Next by thread: Re: divide & conquer algorithm to implement string matching
- Index(es):
Relevant Pages
|