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

The perimeter of a parallelogram is 46in. If the length of one side is 14in., what is the length of a side adjacent to it?
How are radioactive probes useful in DNA fingerprinting
round this number 3.899 to the nearest hundredth
How are radioactive probes useful in DNA fingerprinting
round this number 3.899 to the nearest hundredth
If, 2=5 3=10 4=17 5=??
of the400 doctors who attended a conference, 240 practiced family medicine and 130 were from countries outside the United States. One-third of the family medici
Find the error Jacob is finding the slope of the line that passes through x(0,2) and y(4,3).circle his mistake and correct it.
round this number 3.899 to the nearest hundredth
If, 2=5 3=10 4=17 5=??