i thinks mine is just O(n) On Sun, Jul 10, 2011 at 5:31 AM, Yogesh Yadav <medu...@gmail.com> wrote:
> @raj : > > array a[]= 2,3,5,6,7,8,10,12 > diff[]= 1,2,1,1,1,2,2 > > maxcount=tempcount=1 // because am not takin in consideration of 0th > index value of diff[] > > now in for loop > for j=1 > check diff[j]==diff[j-1] //not equal > so check tempcount>maxcount or not //its also not > so maxcount remains same and tempcount becomes 1 again > > now for j=2 > > check diff[j]==diff[j-1] //not equal > so check tempcount>maxcount or not //its also not > so maxcount remains same and tempcount becomes 1 again > > now for j=3 > > check diff[j]==diff[j-1] // equal > so tempcount++; > > and so on.... > > > > > On Sun, Jul 10, 2011 at 5:23 AM, raj singh <ankurkaku...@gmail.com> wrote: > >> @yogesh- can u explain with an example pls? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.