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 |
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?
Explain different parts of an instruction. What does the addressing mode bit specifies?
Please help to write testcase for ECG machine
WAP in Java to print the format AMIT M I T
what is isolator
How we calculate steam turbine governor linkage assembly?
1)what to do in emergency situation of having total blackout (on a ship) 2)what to do in emergency situation of flooding in the engine room 3)under what conditions would engine room bilges be pumped overboard? 4)why is high pressure required for the injection of fuel into the cylinder of diesel engine. 5)why is doubled walled pipes employed for high pressure fuel lines? 6)reasons for overheating of main engine 7)how to detect choked fuel valve,leaky piston rings and their remedies during operation in diesel engine? 8)effects of insufficient or excessive cylinder lubrication? 9)causes of a diesel engine piston overheating.
sir, plz send me the question regarding DMS gr1 questions of previous year as my exam is on 27/09/08...thanking u in advance...
How do I unlock my laptop if I forgot my administrator password, a Toshiba running Windows 7?
If a CPU has 20 address lines but MMU does'nt use two of them. OS occupies 20K. No virtual memory is supported. What is the maximum memory available for a user program?
can we specify variable field width in a scanf() format string? if possible how in c language?
what type of questions pannel ask to the intervier? plz i want questions about computer engineering? System security subject.