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 is difference between shell commands and shell scripting commands or both r same?
How we calculate the recovery of steam as per coal in a boiler if we know the calorific value of coal?
If I am in a room with 5 people and guess all their birthdays what is the probability of getting (only) one correct?
what type of questions pannel ask to the intervier? plz i want questions about computer engineering? System security subject.
is there any better model than jcb 3dx
Write a C program to solve the quadratic equation ax^2+bx+c=0. A quadratic equation has two roots which are given by the following two formulas: root1= -b+sqrt(b^2-4*a*c)/2*a root1= -b-sqrt(b^2-4*a*c)/2*a The program request the user for input a,b,c and the output will be root1 and root2.
how convert the spiral model to prototype model ?
Whet is KCFT and difference between CFM and KCFT
how to cable size by Amp with example
hi to all,i done ccna,now im looking job,but it is very diffcult to get job in networking field,.........i dnt know what im doing wrongly,kindly help me and give the proper way...i have so much of interest in this field only
what is fabrication process?
what is SOA in DNS