@Ravi : if your solution is acceptable then there is no need ok modifying
data structure.
we can use hashMap which table address and count as an input.

then we can move in same fashion as you have mentioned , if count is of
given address is 1 then it means that address is the intersection point.




On Thu, Dec 15, 2011 at 10:19 PM, atul anand <atul.87fri...@gmail.com>wrote:

> @Ravi : your solution will not work for all the cases because of the
> restriction
> *
> *
> *1)You should not traverse to the end any of the linked list.*
> *
> *
> now consider one linked list to be very large while other is very small
> say 1/5 of the large one.
>
> now because second linked list is short and it will reach to the end of
> the linked list before first linked list has reached the intersection point
> hence it violates the rule.
>
> On Thu, Dec 15, 2011 at 8:56 PM, Ravi Ranjan <ravi.cool2...@gmail.com>wrote:
>
>> in the link list take another variable suppose toggle and initialize all
>> with 0,,, at the time of declaring the link list( so no traversal of
>> entire link list).. now starting from both head traverse a single element
>> at a time but in alternating way... for one linklist the toggling value is
>> set to 1, while another linklist sets its next element value to 2,,,,, now
>> for any one of the list that reaches to the merge point.. will change its
>> value either by 1 or 2.. when the other one reaches the junction and if it
>> finds  a non zero b\value then will confirm it wil be the junction.... so
>> without traversing the entire linklist one can determine the merge point
>>
>>> --
>>>
>>
>> Ravi Ranjan Sinha
>> final yr
>> computer science
>> NIT Jalandhar
>>
>>>  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.
>>
>
>

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