3. A team of programmers is trying to determine the efficiency of a piece of code. They run the code with inputs of different sizes and also record the number of iterations through the core block of code. The data is recorded in the table below.

3 A team of programmers is trying to determine the efficiency of a piece of code They run the code with inputs of different sizes and also record the number of class=

Respuesta :

Answer:

The algorithm's runtime has been divided into two main categories are given below.

Explanation:

  • Polynomial runtime would be defined as almost any run time that doesn't even improve quicker than [tex]n^k[/tex], including fixed time ([tex]n^0[/tex]), logarithmic time (log2{n}), linear ([tex]n^1[/tex]), quadratic ([tex]n^2[/tex]), as well as another polynomial of higher degrees (such as [tex]n^3[/tex]).  
  • The runtime that grows more than [tex]n^k[/tex] and contains exponential time including such ([tex]2^n[/tex]), factorial time (n!), or anything else is super polynomial runtime.
  • It seems it is perceived that polynomial runtime seems to be rational as well as super polynomial growth in order are rendered irrational. It is not necessarily ideal to have a polynomial run time, but it's least theoretically possible.

Then maybe we can easily see by the information collected that perhaps the algorithm is increasing at either the frequency of 20×n. At which, across every iteration, n seems to be the input dimension. This suggests that perhaps the runtime specified seems to be of a polynomial category, therefore means that even this technique executes within a rational period.

fichoh

Reasonable and unreasonable algorithm is differentiated based on the growth rate of the iterations as input is increased. Since the algorithm does not grow exponentially, then we can conclude that the algorithm runs in a reasonable time.

Evaluating the mathematical function which models the growth rate of the algorithm as the number of input is increased ;

200 = 10k ; k = constant of proportionality

k = 200/10

k = 20

Thus, the function which models the number of iterations is :

  • n = 20i ; number of iterations ; i = input size

Since, the iteration does not grow exponentially, then it runs in a reasonable time.

Learn more : https://brainly.com/question/20504501