Twisted linked list problem: Two linked lists merge at some node p,both the
head pointers are given find the merging point under
the following restrictions.
1. You should not traverse to the end any of the linked list.
2. Merge node p should be detected by the time you reach at most most k
nodes
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
seem like very twisted problem :P :P . lot of restriction.
On Thu, Dec 15, 2011 at 7:30 PM, Ankur Garg ankurga...@gmail.com wrote:
Twisted linked list problem: Two linked lists merge at some node p,both
the head pointers are given find the merging point under
the following restrictions.
1.
@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
@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.
i got my mistake..
den how to fulfill all the conditions??
--
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