Yes I Think Its Obviously O(N) Algorithm :P Here is Approach
Algorithm: Take 0th index value from 1st array & 1st index value from 2nd array store it in S1 Now 0th index value from 2nd array & 1st index value from 1st array , store in S2 Also stores starting & ending index of each array -take care-off initialize maxsum variable to a[0]+b[0] Keep checking until we found kth sum from array a & b where a is from 1st & b is from if s1>s2 then increment array b lastindex until its equal to length of this array & update maxsum=s1 else then increment array a last-index until its equal to length of this array maxsum=s2; Finally Return maxsum; Here is More info http://shashank7s.blogspot.com/2011/08/find-kth-largest-sumab-possible-where.html Thanks Shashank Mani Computer Science Birla Institute of Technology,Mesra -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/AhjalZ6ly_cJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
