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 |
I have done BE ( computer science) i secleted in sbi clerical written exam. so what questions they asked according to my subject please send me the answer
0 Answers State Bank Of India SBI,
can we specify variable field width in a scanf() format string? if possible how in c language?
why multiple inheritence concept is not supported in c#?
hai...i need the interview questions of php...its very urgent
Show the forces acting on a ladder
write a c program which accept input as:Anu.B.Kapur and give out as:Kapur.A.B using pointers
What are the different types of testing? What is SDLC? Manual of automated?How to choose among these two?
what is block size and how to solve this?
hi........ i am a student of computer science. i want to earn some money on net so that i can help my parents. so please suggest me some sites which give online part time jobs without any registration charges. please help me. i will be very thankful to you. varinder.
please send me minimum 15 library functions in c
Relative Humidity (RH) is mostly used word in Datacenters, What are the defendents of RH
Sir, I was recently placed at ITC Infotect. My ctc is 2.46lpa. How much will I get in hand every month? Plssss answer. Thanx in advance.
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)