heh could u explain the question with a example..??!!
On Aug 18, 8:47 pm, ♪ ѕяiηivαѕαη ♪ <21.sr...@gmail.com> wrote:
> Hi..
> Can anyone here explain me /provide me with an algorithm/source code in C
> which efficiently finds out the *longest common substring in the given
> string??*
--
You rec
The loop is at the end as you have said.
--~--~-~--~~~---~--~~
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 e
To find the length of the loop:1)You know the node where the two pointers have met.(say NodeX)2)Now make one pointer alone traverse through the loop.(Have a counter which increments for every move)3)It will come back to the same node (NodeX) after making 'length of the loop' jumps
ie the counter g
>>sorry i forgot to mentioned>>that array may or may not have a majority element.
If the array may or may not contain the majority element, then after
the last step(ie once you get the get the array with one element) ,
just iterate thru the original array once counting the number of
occurences of t
Yes , this will work.Here there are nine elements :So after pairing , you get3,1 3,2 3,4 3,5 3The first four pairs donot yield anything.The last lone element 3 is alone taken which is infact the majority of the the array.
I would also like to eloborate what Karthik had said:From the first array
Hi jatin,
why not send the book to the group
vinodh
--~--~-~--~~~---~--~~
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
Hi,
I think there is a small modification in the equations :
X= (D2 + D1^2)/(2*D1)
Y= (D2 - D1^2)/(2*D1)
Vinodh