1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kumpel [21]
3 years ago
6

Suppose for the worst case, given input size n: Algorithm 1 performs f(n) = n2 + n/2 steps Algorithm 2 performs f(n) = 12n + 500

steps What is the smallest value of n for which algorithm 2 will be faster than algorithm 1?
Computers and Technology
1 answer:
melomori [17]3 years ago
6 0

Answer:

29

Explanation:

for n=28:

--------------

Algorithm 1 performs f(n) = n2 + n/2 = 28*28 + 28/2 = 798

Algorithm 2 performs f(n) = 12*28 + 500 = 836

for n=29

--------------

Algorithm 1 performs f(n) = n2 + n/2 = 29*29 + 29/2 = 855.5

Algorithm 2 performs f(n) = 12*29 + 500 = 848

so, for n=29, algorithm 2 will be faster than algorithm 1

You might be interested in
A fast food chain that wants to inform consumers about its latest dollar menu item will most likely use ___ to do so. ____ may i
Eva8 [605]
The correct answer is 1: B new tech and 2:C we can tell by the way businesses are incorporating things like social media like how Wendys got more popular because of their sassy tweets
3 0
3 years ago
Read 2 more answers
Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. T
MrMuchimi

In python 3.8:

user_input = input().split()

x = user_input[0]

char = user_input[-1]

for w in range(1,int(x)+1):

   if char in user_input[w]:

       print(user_input[w])

I hope this helps

7 0
3 years ago
True or false?
kenny6666 [7]

Answer:

True

Explanation:

An effective way of protecting programs against classic stack overflow attacks is to instrument the function entry and exit code to setup and then check its sack frame for any evidence of corruption.

5 0
3 years ago
Read 2 more answers
¿ cuales son las características de revolución industrial?
Daniel [21]

Answer:

La producción industrial a gran escala, especialmente de alimentos. ... El desarrollo de nuevas industrias como la textil, la siderúrgica (metales) o la minera. La sustitución del hierro por el acero, un material más duro y resistente.

Espero que esto sirva!

7 0
3 years ago
During the troubleshooting of a pc that will not boot, it is suspected that the problem is with the ram modules. the ram modules
Damm [24]
The modules were somehow disconnected
8 0
3 years ago
Other questions:
  • Waterpower was first harvested by ancient societies using
    5·1 answer
  • Personal Web Page Generator Write a program that asks the user for his or her name, then asks the user to enter a sentence that
    11·1 answer
  • What is the correct order of network types when categorized by their size or the physical area they cover, from largest to small
    10·1 answer
  • Which tab provide text formatting features
    11·1 answer
  • What is a benefit of the Name Manager feature?​
    12·2 answers
  • Communication is defined as__________.
    10·1 answer
  • Light is a key formal element that film artists and technicians carefully manipulate to create mood, reveal character, and conve
    15·1 answer
  • Natalie is a secretary and must complete a large amount of filing this afternoon. At 1:00 PM, the office receptionist gets sick
    10·1 answer
  • In Secure Electronic Transaction, the purpose of Dual Signature is to link two messages that are intended for two different reci
    5·1 answer
  • PLEASE HELPPPPPPP What should you always disconnect before installing hardware inside a computer’s case?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!