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

One of your responsibilities will be to prepare and train on standard work instructions or quality initiatives. What experience and qualifications do you have that will enable you to succeed in this role?

0 Answers  


Explain different parts of an instruction. What does the addressing mode bit specifies?

0 Answers  


Please help to write testcase for ECG machine

0 Answers  


WAP in Java to print the format AMIT M I T

0 Answers  


what is isolator

0 Answers  






How we calculate steam turbine governor linkage assembly?

0 Answers   Ispat,


1)what to do in emergency situation of having total blackout (on a ship) 2)what to do in emergency situation of flooding in the engine room 3)under what conditions would engine room bilges be pumped overboard? 4)why is high pressure required for the injection of fuel into the cylinder of diesel engine. 5)why is doubled walled pipes employed for high pressure fuel lines? 6)reasons for overheating of main engine 7)how to detect choked fuel valve,leaky piston rings and their remedies during operation in diesel engine? 8)effects of insufficient or excessive cylinder lubrication? 9)causes of a diesel engine piston overheating.

0 Answers   Maritime Academy,


sir, plz send me the question regarding DMS gr1 questions of previous year as my exam is on 27/09/08...thanking u in advance...

0 Answers  


How do I unlock my laptop if I forgot my administrator password, a Toshiba running Windows 7?

2 Answers  


If a CPU has 20 address lines but MMU does'nt use two of them. OS occupies 20K. No virtual memory is supported. What is the maximum memory available for a user program?

1 Answers   Wipro,


can we specify variable field width in a scanf() format string? if possible how in c language?

1 Answers  


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

0 Answers  


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)