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 |
what are register variables?what are the advantages of using register variables in c language?
HELLO EVERYONE ON YAHOO , I'M IN NIGERIA AND I Will LIKE TO MOVE AND WORK IN CANADA , ANY SKILLED WORK IS OK BY ME AND THE PERSON WILL PAY THE BILL FOR IT, I WILL SERVE THE PERSON FOR THE EXPENSES.......... LOVE TO READ FROM YOU SOONEST AS YOU WISH TO HELP ME OUT
Please send the details and fee for Intools training course..I would like to do the course in second week of jUNE 2010.
what is 3d gard
Given two strings, find the sub-string of the first string having minimum length which is having all the characters in second string
If a stored procedure is taking a table data type, how it looks?
hey,,,hi have taken an emergency date of 21st july...i was continuously checking for dates n i was not able to get a normal date n my school is starting from 8th of september...so plz tell me can i get a rejection based on this, that i have taken an emergency date?????
hi, please send me "state bank of india", last 5 years question paper with answers to my mail id.
in header files whether functions are declared or defined in c language?
write a program greater then three numbers without if, if...else,while,do..while,for,switch statement.
What is the difference between wimdow Nt, 2000 amd 2003 server ?
How would you design a gravity dam for holding back water?