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
6 + 7 = 7 + 6 is an example of which property of addition?
Sauron [17]

Answer:

commutative

Explanation:

The commutative property states that the numbers on which we operate can be moved or swapped from their position without making any difference to the answer.

8 0
3 years ago
Read 2 more answers
What is a data dictionary, what does it contain, and how is it used?
seropon [69]
A data dictionary<span> is a collection of descriptions of </span>data<span> objects or items in a </span>data <span>model for the benefit of programmers and others who need to refer to them. The first step in analyzing a system of objects with which users interact is to identify each object and its relationship to other objects.</span>
7 0
3 years ago
Write a program that input a number and display its precessor and successor number using function.
muminat

Answer:

def ask():

x = int(input("Pick a number: "))

p = x - 1

s = x + 1

print("The predecessor is {} and the successor is {}.".format(p, s))

ask()

Explanation:

"def ask():" and everything indented defines the function and "ask" calls the function.

6 0
3 years ago
Where can a user enter new tasks in outlook
VARVARA [1.3K]

Next to file, you should see home. If you click on home, directly underneath it, you will see new task.

5 0
3 years ago
Aight Ik this aint an assignment question but I just need to vent
eduard

Answer:

Your everything

Explanation:

That's your friends opinion that your "ugly" nothing will hurt it you don't take it to the heart. Don't be sorry, if they were truly your friend they wouldn't have said those. Your good yourself you don't have to have to have someone say you are good. You are good as yourself. Don't change, for anyone. Your beautiful. :) <33

4 0
3 years ago
Other questions:
  • Jeff wants to print quickly so he presses the Ctrl and the P. Jeff used a _____. macro invoice template shortcut
    15·1 answer
  • Write a short java method that takes an integer n and returns the sum of all the odd positive integers less than or equal to n.
    5·1 answer
  • Type the correct answer in the box. Spell all words correctly. Joseph is a digital media developer and has years of work experie
    15·1 answer
  • Which words in the sentence make up the adjective phrase? Which word does the adjective phrase modify? The farmer delivers five
    15·1 answer
  • I’m turning my Pinterest into a professional account what should be my user name please try to think of a good name and not just
    11·2 answers
  • Kareem is working on a project for his manager. He has a few questions for a co-worker who he knows is knowledgeable on the subj
    7·1 answer
  • Plsss help anyone PLSSSSS ​
    13·1 answer
  • What is the primary purpose of the destination address?
    9·1 answer
  • What does the following code print? time_of_day = ["morning", "afternoon", "evening"] for word in time_of_day: print "Good " + w
    15·1 answer
  • a good way to repeatedly perform an operation is to write the statements for the task once and then place the statements in a lo
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!