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
how updates the data in target tables with tpump and mload? with low volume data and more duplicates... so in this case which perfomance is best? and write update query for tpump&mload?
what's the difference between windows serevr 2003 or windows XP.
which is the better form java or .net?exactly when we have to choose particcular 1 among them?
Hi, I am appearing for the ISRO exam for the post of Scientist/ Engineer to be held on 26th April,09. Can anyone help me regarding the same? I want to know about the exam pattern and the syllabus. If anyone could share your experience or sample papers for the same at khadhar786@rediffmail.com? It would be very useful for me. Thanks.
What is the difference between operator overloading and function overloading in C when compared with C++?
what is the class of generator A b & c
What kind of question can be asked at the time of Interview for State Bank Of India Clerical Interview
what is Pick map and what is the use of it? I want to configure a MVG applet on a filed in opportunity form applet. and when i select fields from MVG , it should reflect on the form applet(means there should be changes on fields in MVG according to Field select from MVG appler). Is this possible (with MVG or Picklist)?
when air is supplied from larger diameter pipe with some pressure if change diameter to small pipe the pressure increases or not? also what is increased pressureor velocity?
can 25mm thik and 8.5x8.5 size cast iron plate can bear a weight of 250 tons if it can what would be the compostion
What is the difference between a gun and a rifle and what advantage does a spinning bullet have?
hi friends i am first time using this site.i came to by some tcs personals that certifications r important for placements.i am financially average i am learning java from books.please tell is it enough if not which certification should i go for
i am Ali from Hyderabad,having twice rejected on conference visa(USA),possessing 9 years of teaching experience,my current ielts score is 6 bands and my current age is 34,do suggest me some suitable universities for MBA course in USA,and what are the prospect of getting a visa.
write a c++ program to interchange two-integer number without using the third variable. use concept of constructor overloading.
difference between arrays and linked list in c language?