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

what is 5.71 rounded to the nearest whole number
A rectangle whose perimeter is 80 m has an area of 384 m^2. Find the dimensions of the rectangle.
What part of the cell function as factories to produce proteins???
what is an example of a narrative poem
If a car can go from 0 to 60 mi/hr in 8.0 seconds, what would be its final speed after 5.0 seconds if its starting speed were 50 mi/hr?
How did world war 1 contribute to the collapse of the Russian monarchy?
Give all solutions if the nonlinear system of equations, including those with no real complex components. y=x^2+6x 4x-y=-24
What is cos P?  Right triangle PQR with a short leg measuring 5, a long leg measuring 12, and the hypotenuse as 13A. 5/12B. 12/13C. 5/13D. 12/5
What is a federal scout
what types of units are used to describe area?