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
Which type of virus includes protective code that prevents outside examination of critical elements?
Vlad1618 [11]

Answer:

Armoured viruses

Explanation:

Armoured viruses are computer viruses that have been found to be very dangerous, Armoured viruses ar designed to protect itself against any attempt to detect or trace Its activities. They have different ways through which they bypass antivirus software applications in a computer system, making it very difficult to eliminate from an infected system.

5 0
3 years ago
dash is a set of communication standard using for transferring file information between computers in a network​
8090 [49]

Answer:

protocol

Explanation:

hope this helps.

4 0
2 years ago
This type of method method performs a task and sends a value back to the code that called it:
Thepotemich [5.8K]

Answer:

Option 4: Value-returning

Explanation:

In programming, a method is a named section of codes that perform a specific task. This is possible to define a method that return a value after performing its task. This type of method is known as Value-returning method.

For example, we can define a method addition that takes two inputs, x, y and return the summation of x + y to the code that called it. The codes are as follows:

  1.    public static void main(String[] args) {
  2.        int sum = addition(3, 5);
  3.    }
  4.    
  5.    public static int addition(int x, int y){
  6.        return x + y;
  7.    }

6 0
3 years ago
Why do bats sleep upside down
seraphim [82]

Answer:

Bats cannot run so it would be almost impossible for them to take off from the ground. A major advantage to hanging upside down is that bats do not need to generate lift to begin flight. They just drop out of their bed, open their wings and off they go.

Explanation:

8 0
3 years ago
Date criteria are automatically enclosed in ____ when entered in a query design.
inysia [295]
Enclosed in number signs ######
4 0
3 years ago
Other questions:
  • Suppose your company has decided that it needs to make certain busy servers faster. Processes in the workload spend 60% of their
    5·1 answer
  • When did the silver market drop sharply, hurting Bolivia's income?
    7·2 answers
  • You can access various sites on the WWW by using hyperlinks or by
    14·1 answer
  • What is secondary exchange ? - Apex
    14·1 answer
  • he fundamental building block in every Hypertext Markup Language (HTML) document is the _____ tag, which marks a component in th
    7·1 answer
  • Pls help me!!!!!!!!!!!!!
    5·2 answers
  • str1=”Good” str2=”Evening” Does the concatenation of the above two strings give back a new string or does it concatenate on the
    14·1 answer
  • Questiul 2
    10·1 answer
  • Which of the following is a web app?
    5·1 answer
  • What defines the scope of a project?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!