Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

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?

2163


what's the difference between windows serevr 2003 or windows XP.

2076


which is the better form java or .net?exactly when we have to choose particcular 1 among them?

1772


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.

2124


What is the difference between operator overloading and function overloading in C when compared with C++?

1824


what is the class of generator A b & c

1621


What kind of question can be asked at the time of Interview for State Bank Of India Clerical Interview

2103


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)?

2098


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?

1793


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

1742


What is the difference between a gun and a rifle and what advantage does a spinning bullet have?

1378


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

1786


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.

1898


write a c++ program to interchange two-integer number without using the third variable. use concept of constructor overloading.

2255


difference between arrays and linked list in c language?

2036