keep a ptr ( pt1) at the beginning of the list.
do
increase another pointer ( pt2) by 1 and another pointer(pt3) by 2
while ( pt3 does not point to the same location as pt1)

On Sat, Mar 27, 2010 at 11:01 AM, Rohit Saraf
<rohit.kumar.sa...@gmail.com>wrote:

> how do u define middle when there is a cycle in the list ?
>
> -Rohit
>
>
>
> On Sat, Mar 27, 2010 at 12:11 AM, Sanjana <sanjana.2...@gmail.com> wrote:
>
>> Hello,
>> Can someone help me out with this. How to find the middle of a singly
>> linked list which also has  a cycle in it.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algoge...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@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.

Reply via email to