Re: [algogeeks] MICROSOFT IDC: unsorted linked lists intersection

2011-12-31 Thread Ashish Goel
merge two linked list without sorting them, the resultant list should be sorted one... any other better solution? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jan 12, 2011 at 3:15 PM, Ashish Goel ashg...@gmail.com wrote: without

Re: [algogeeks] MICROSOFT IDC: unsorted linked lists intersection

2011-01-12 Thread Ashish Goel
without sorting, it will be mess...O(n^2) with recursion, it will be lot of stack space however since this is asked i would do it this way The only problem i see with this code is what if the lists are 1,2,1,2 AND 2,1,1,1 This code will give 2 common message twice and 1 common message 4 times