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



Give an algorithm for the following problem and determine its time complexity. Given a list of n ..

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

Post New Answer

More Engineering AllOther Interview Questions

what is difference between shell commands and shell scripting commands or both r same?

0 Answers  


How we calculate the recovery of steam as per coal in a boiler if we know the calorific value of coal?

0 Answers  


If I am in a room with 5 people and guess all their birthdays what is the probability of getting (only) one correct?

0 Answers  


what type of questions pannel ask to the intervier? plz i want questions about computer engineering? System security subject.

0 Answers  


is there any better model than jcb 3dx

0 Answers  






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.

1 Answers  


how convert the spiral model to prototype model ?

0 Answers  


Whet is KCFT and difference between CFM and KCFT

0 Answers  


how to cable size by Amp with example

0 Answers   Uniflex,


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

0 Answers  


what is fabrication process?

1 Answers   L&T,


what is SOA in DNS

1 Answers   NetMagic,


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)