@ vishal : how can u divide an array into 2 groups whose difference is maximum in O(1). why max?
solution : http://www.youtube.com/watch?v=GdnpQY2j064 On Fri, Nov 16, 2012 at 9:22 AM, vishal chaudhary <vishal.cs.b...@gmail.com>wrote: > Hi > you can first sort the array which can be done in O(nlogn) complexity if > the number of items in the array is n. > Then using the indexing of arrays you can divide the array into two groups > whose difference is going to be maximum and this can be done in O(1) > complexity. > So the complete algorithm is going to take O(nlogn) complexity. > Kindly share an alternative algorithm if you find one with lower > complexity. > > Vishal > > > On Wed, Nov 7, 2012 at 7:43 PM, Arun Kindra > <reserve4placem...@gmail.com>wrote: > >> Given an unsorted array, how to divide them into two equal arrays whose >> difference of sum is minimum. >> >> -- >> 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.