Give an algorithm for the following problem and determine
its time complexity. Given a list of n distinct positive
integers, partition the list into two sublists, each of
size n/2, such that the difference between the sums of the
integers in the two sublists is maximized. You may assume
that n is a multiple of 2 (i.e. n is even).

Answer Posted / ali

In the case of T(n) = n, say O(n), and n is 1000, then on
the old computer 1 minute and the new one, 1/1000 minute
For T (n) =n3, the size will be 1000^3 = 1000,000,000 which
takes 1000,000 minutes on the old computer and 1000 on the
new one
For T(n)=10n Because of the limited space, I won’t write
1000 ZEROs here, instead it’s clear that it takes 10^997
minutes on the old computer, and 10^994 minutes on the new one.

Is This Answer Correct ?    3 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a c program which accepts input as Anu.B.Kapoor and gives output as:Kapoor.A.B plz send me the ans

1137


why multiple inheritence concept is not supported in c#?

1538


Can u send me a sample Final year CSE student 'RESUME' for campus placement to following mail id: aspnetworks@gmail.com

3223


What is the difference between tcp/ip protocol and IP protocol?

1794


what is a structure in c language?

1361






model question papers of GrayOrange company

939


what's the difference between windows serevr 2003 or windows XP.

1649


I am selected interview for computer sc.please give me some information how many types question asked in interview.my id is sumanadas10@gmail.com

1342


which is better php,asp.net,jsp? and why?

1329


What is Landscape in Sap BW?

1665


Sketch a velocity time graph for a skydiver jumping out of a plane.

777


how can i install windows-xp operating system in single time to 50 computersconnected in a LAN.

1848


Apply Newton?s method to compute the approximate value of root 2. Start the iteration from x0=1, and obtain two iterations.

1578


How is the parity flag actually set in the 8085 microprocessor?

1601


difference between arrays and linked list in c language?

1559