geoffreyrulz4542 geoffreyrulz4542
  • 01-01-2021
  • Computers and Technology
contestada

Imagine that we have a list of names called nameList. There are various algorithms we could run on it. Here's one such algorithm, which compares each name in the list to every other name:

Respuesta :

IfeanyiEze8899 IfeanyiEze8899
  • 02-01-2021

Answer:

The algorithm has a quadratic time complexity of O(n^2)

Explanation:

The algorithm has two nested for-loop statements. The length of the name list is denoted as "n". Every name searched in the name list has a time complexity of n, therefore the time complexity of finding two names is (n x n) =  n^2, which is denoted as O(n^2) in Big-O notation.

Answer Link

Otras preguntas

Geometry math question please help
in a recent town election, 75% of the 16000 people voted of the voting people,60% voted for the current mayor and 120 voted were invalid.how many people voted f
the height of a projectile is launched upward at a speed of 32 feet/per second from a height of 48 feet. how long will it take the projectile to hit the ground
Determine the length and midpoint of the segment whose endpoints are (–15, 9) and (–4, 11). A. length = 11.18, midpoint = (–5.5, 1) B. length = 11.18, midpoint
In the U.S., the iron and steel industry is concentrated in the: A.South B.North C.Midwest D.West
(1/x-2)-(1/x+2)=(A)=0(B)=-(1/4)(C)=(-4/x^(2))(D)=(4/x^(2)-4)(E)=(2x/x^(2)-4) show work
What is the length of AC¯¯¯¯¯ ? Enter your answer in the box.
Which element is oxidized in the reaction below? fe+2 + h+ + cr2o7-2 fe+3 + cr+3 + h2o?
What is the length of the diagonal of the square shown below?
Please help answering questions 215 and 216.