moreover n/2-1 will never be the middle element. in case of even no. of
nodes ,middle shall be n/2 and n/2+1

On Mon, Jul 11, 2011 at 6:19 PM, chandy jose paul <jpchaa...@gmail.com>wrote:

> dnt worry about that write a code in which initialy 2 ptrs .move 1 ptr 2
> nodes at a time and other ptr 1 time.when the first ptr reaches end then
> seconf ptr will be at middle
>
> On Mon, Jul 11, 2011 at 6:15 PM, vaibhav shukla 
> <vaibhav200...@gmail.com>wrote:
>
>>  i have considered it  (n/2+1)th
>> and didn't bothered much :P
>>
>>
>>
>> On Mon, Jul 11, 2011 at 4:57 PM, Anika Jain <anika.jai...@gmail.com>wrote:
>>
>>> *if i have to write a code for finding middle element in a linked list..
>>> then for even length linked which will be the middle element both n/2-1 and
>>> n/2+1 or just n/2+1???
>>>
>>> if its both then how can i make my function two elements??
>>> *
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>>   best wishes!!
>> Vaibhav Shukla
>>     DU-MCA
>>
>>
>>  --
>> 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.
>



-- 
  best wishes!!
Vaibhav Shukla
    DU-MCA

-- 
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.

Reply via email to