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
write a c program which accepts input as Anu.B.Kapoor and gives output as:Kapoor.A.B plz send me the ans
why multiple inheritence concept is not supported in c#?
Can u send me a sample Final year CSE student 'RESUME' for campus placement to following mail id: aspnetworks@gmail.com
What is the difference between tcp/ip protocol and IP protocol?
what is a structure in c language?
model question papers of GrayOrange company
what's the difference between windows serevr 2003 or windows XP.
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
which is better php,asp.net,jsp? and why?
What is Landscape in Sap BW?
Sketch a velocity time graph for a skydiver jumping out of a plane.
how can i install windows-xp operating system in single time to 50 computersconnected in a LAN.
Apply Newton?s method to compute the approximate value of root 2. Start the iteration from x0=1, and obtain two iterations.
How is the parity flag actually set in the 8085 microprocessor?
difference between arrays and linked list in c language?