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 progremme using function 0f prime no.?
Tell me about a time when you had too many things to do and you were required to prioritize your tasks
difference between windows 2003 and windows 2008 server
WHAT IS DIFFERENCE BETWEEN ART & VECTOR QUANTISATION BASED ON THEIR APPLICATION IN NEURAL NETWORK
what is your career objective?
what is the difference between physical address and logical address?
Key difference between ip10 and ip20 of ceragon equipment?
Why it is a preferable option in parallelextender development ?
how to create user name stape by stape in cisco router {with command}
Three pc now connected the 24 port switch.one pc ip adders 192.168.0.125,anather pc ip is 192.168.0.98, anather pc ip is 192.168.0.123, so 98 or 125 ping replay to 123,but 123 is not replay 125 or 98, but 123 is others pc ping replay,
I am some what lagging in talking English but i love to do job as an software engineer what will i do to improve my communication skills? please give me answer..........
how many gallon in one quseka
Explain force?
What is the significance of superconductors?
Hi dost here Alok Kumar please send question pattern for NIC at godinall.kumar1@gmail.com or alok.iitb07@gmail.com