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

A similarity between the governments of Iran and Saudi Arabia is that __________. A. neither allows political parties B. both are monarchies C. both have consti
aflati numerele de forma 5x2y devizibile cu 18
dee dee bought an apple for $0.85, a sandwich for $4.50, and a bottle of water for $1.50. how much did dee dee spend?
Who was the communist leader of Cuba during the Cuban Missile Crisis? A. Joseph Stalin B. Vladimir Lenin C. Fidel Castro D. Leon Trotsky
The Lafayette County Library classifies it's DVDs into one of the categories shown below. The library owns 1743 DVDs. Round your answer to the nearest whole n
how is 89 a prime number
what is 4 times something 32 besides 8
f(x)=22xplus 33 and ​g(x)=x2−44x−55​, find ​(g◦​f)(88​)
How do you reset a Health o Meter scale?
what were the major achievements of the second continental congress?