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

which areas were obtained after the revolutionary war?
Estimate the value of 21*3.86/0.207 anyone knw the estimate for this?
what is a vortex? need some help
70-q-q-2q=80 We'll this is confusing
Ho does differentiation change an embryo as it develops
If x= (a^2)/b, which situation would always double the value of x? (1) Doubling the value of a(2) Halving the value of a(3) Doubling the value of b(4) Halving t
3)    Write an equation for a graph that is the set of points in the plane that are equidistant from the point  F(6,0) and the line x = -6.
isabella has found that she stays the most fit by running variouse dinstances and terrains through out the week. On mondays she runs 2.5 miles, on tuesdays 4.6
Express the exact value of csc 60 degrees with a rational denominator?
how can astronomers use rocks from the moon to estimate the age of the solar system ?