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 civilization used a 365-day calendar and built their cities at thebes and memphis mesopotamia, indus valley, china or egypt
¿cómo va a pagar pablo?
18/14in simplest form
Tú ________________ alto. a. es c. soy b. eres d. estás
Which of the following is the best estimate for checking the given problem? 17,256 - 6,193 = 11,063
Nicholas bought three business related books. His total bill was $150. If one book cost him 50% more than the other two books combined what was the price of th
a jar contains a mixture of 20 black marbles, 16 red marbles, and 4 white marbles, all the same size. find the probability of drawing a white or red marble on t
Who is not a flat character in The Tragedy of Julius Caesar? Lepidus Mark Antony Messala Pindarus
What is the proper or customary behavior in your work environment?
which property is illustrated by the following statement? if hxa =rgi, then rgi =hxa