@abinesh: The solution given has a very very high complexity. as it finds all possiblilities and tests each one of it. is it *n*[(2n!)/(n! * n!)]* --> This is exponential solution. I am not sure but, there must be a DP solution to this .
--Sravan Reddy On Wed, Jul 11, 2012 at 12:15 AM, arumuga abinesh <arumugaabin...@gmail.com>wrote: > http://www.geeksforgeeks.org/archives/17743 > > Using the above problem we get all possible merges , at each possible > merge, we can calculate the sum. > > On 7/11/12, Mr.B <sravanreddy...@gmail.com> wrote: > > I think you missed the question: > > Its a stable merge. (order of elements in each array should be same) > > Sorting will destroy the original order. > > > > Thanks, > > Mr.B > > [Please include complexities and pseudo-code] > > > > On Tuesday, 10 July 2012 16:18:04 UTC-4, Akshat wrote: > >> > >> Here you have to first sort both the arrays A and B and merge both the > >> arrays to form the sorted array C > >> > >> -- > >> > >> > >> Akshat Sapra > >> Under Graduation(B.Tech) > >> IIIT-Allahabad(Amethi Campus) > >> *--------------------------------------* > >> sapraaks...@gmail.com > >> akshatsapr...@gmail.com > >> rit20009008@ <rit20009...@gmail.com>iiita.ac.in > >> > > > > -- > > 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/-/uCRLEzDBWAAJ. > > 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.