Re: [algogeeks] string matching problem

2012-09-03 Thread atul anand
above link was for reference , extending the logic was obvious :) :) On Mon, Sep 3, 2012 at 11:22 AM, bharat b bagana.bharatku...@gmail.comwrote: @atul: question is to find the largest continuous sub array .. not just continuous sub array .. we can do this with same logic as mentioned in the

Re: [algogeeks] string matching problem

2012-09-03 Thread bharat b
why can't we change the question to sum=0 .. On Mon, Sep 3, 2012 at 12:57 PM, atul anand atul.87fri...@gmail.com wrote: above link was for reference , extending the logic was obvious :) :) On Mon, Sep 3, 2012 at 11:22 AM, bharat b bagana.bharatku...@gmail.comwrote: @atul: question is to

Re: [algogeeks] string matching problem

2012-09-02 Thread atul anand
http://www.geeksforgeeks.org/archives/19267 On Mon, Sep 3, 2012 at 7:41 AM, Amitesh Singh singh.amit...@gmail.comwrote: Given a array, find the largest contiguous sub-array having its sum equal to N. -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] string matching problem

2012-09-02 Thread bharat b
@atul: question is to find the largest continuous sub array .. not just continuous sub array .. we can do this with same logic as mentioned in the above link.. we have to traverse whole array.. even if we get the solution .. whenever we get the solution,update the largest_subarray_start_index and

Re: [algogeeks] string matching

2011-06-23 Thread aseem garg
Patrick!!! On Thu, Jun 23, 2011 at 11:29 AM, prateek gupta prateek00...@gmail.comwrote: yup, got it thanks!!! On Thu, Jun 23, 2011 at 11:27 AM, sunny agrawal sunny816.i...@gmail.comwrote: last line is *in worst case k=1 only 2*n comparisons will be there hence O(n)* On Thu, Jun 23,

RE: [algogeeks] string matching

2011-06-23 Thread Navneet Gupta
String matching can be performed in linear time with KMP algorithm. could you say what more optimization you are looking for here? Sent from my Windows Phone -- From: prateek gupta Sent: 23/06/2011 11:17 To: algogeeks@googlegroups.com Subject: [algogeeks] string

[algogeeks] string matching

2011-06-22 Thread prateek gupta
In naive string matching how can the knowledge abt. pattern that it has all different characters can be used to accelerate the algorithm to O(n) . -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] string matching

2011-06-22 Thread Piyush Sinha
Read KMP algorithm.. On Thu, Jun 23, 2011 at 11:17 AM, prateek gupta prateek00...@gmail.comwrote: In naive string matching how can the knowledge abt. pattern that it has all different characters can be used to accelerate the algorithm to O(n) . -- You received this message because you are

Re: [algogeeks] string matching

2011-06-22 Thread sunny agrawal
last line is *in worst case k=1 only 2*n comparisons will be there hence O(n)* On Thu, Jun 23, 2011 at 11:26 AM, sunny agrawal sunny816.i...@gmail.comwrote: Lets Consider the case of Naive matching in which at some shift s first k characters are matched and next character does not match so

Re: [algogeeks] string matching

2011-06-22 Thread prateek gupta
yup, got it thanks!!! On Thu, Jun 23, 2011 at 11:27 AM, sunny agrawal sunny816.i...@gmail.comwrote: last line is *in worst case k=1 only 2*n comparisons will be there hence O(n)* On Thu, Jun 23, 2011 at 11:26 AM, sunny agrawal sunny816.i...@gmail.comwrote: Lets Consider the case of