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 / 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 |
Why does the 'divisibility by 3' rule work?
if the bit string 0111101111101111110 is bit stuffed,what is the output string?
what the bridge id of any switches
what is the difference between primary key and foreign key?
please tell me difference between router and cisco router
i am satish i want to preapare for group-1 exams so please help me?
how is the config take place and from reciever side how will process the data into internal table
What are the major network infrastructures for installing Exchange 2003?
WHAT THE DIFFERENCE BETWEEN JCB 3DX & 3D?
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
safety valve calculation?
One of your responsibilities will be to prepare and train on standard work instructions or quality initiatives. What experience and qualifications do you have that will enable you to succeed in this role?
Civil Engineering (5086)
Mechanical Engineering (4456)
Electrical Engineering (16639)
Electronics Communications (3918)
Chemical Engineering (1095)
Aeronautical Engineering (239)
Bio Engineering (96)
Metallurgy (361)
Industrial Engineering (259)
Instrumentation (3014)
Automobile Engineering (332)
Mechatronics Engineering (97)
Marine Engineering (124)
Power Plant Engineering (172)
Textile Engineering (575)
Production Engineering (25)
Satellite Systems Engineering (106)
Engineering AllOther (1379)