103k views
4 votes
Which of the following growth-rate functions would correspond to the shortest running time?

linear

logarithmic

constant

factorial

1 Answer

7 votes

Answer:

The answer is: constant.

Step-by-step explanation:

The Big-Oh analysis informs what is the perform of an algorithm based on the input size(N). Having this in mind you have:

  • O(N) linear.
  • O(log N) logarithmic.
  • O(1) constant.
  • O(n!) factorial.

The shortest running time is the constant function because the running time is always the same and not depends on the size of N.

User Bart Ten Brinke
by
7.9k points