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 the greatest common factor of 21 and 27?
When rolling a standard 6-sided die, what is the probability of rolling an odd number? A. 1/3 B. 1/6 C. 1/2 D. 2/3
3. Alexa wrote the reciprocal of the mixed number incorrectly. Explain why she is incorrect and provide the correct reciprocal.
There does not appear to be any deep underlying stratum of bitterness -- he did not seem to me malignant or revengeful. Which dictionary definition BEST applie
if AB=16 then AD is?​
Explain how the poem uses personification to describe the bayou in Anguilla. What effect does personification have on the meaning of the poem? Cite evidence fro
210000000 in standard form
help!!!!!!!!!!!!!!!​
what happened after the american revolution?​
How to solve : 16=2t + 0.25 t``squar​