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

Meg pounded a stake into the ground. When she attached a leash to both the stake and her dog’s collar, the dog could reach 9 feet from the stake in any directio
Estimate the angle of elevation from the trailhead to the summit.
The sales tax rate is 8%. Estimate the tax on a jacket that costs $69.95.
An object of mass 2 kg has a linear momentum of magnitude 6 kg • m/s. What is this object’s kinetic energy?
Can someone explain lesson 6.3 math boxes in everyday math regarding the missing numbers on the number lines
How many prime numbers are there between 56 and 100?
If 4x+5y=10 and x+3y = 8 then (5x+8y)/3=
What is the average of 30, 40, and 80?
The sales tax rate is 8%. Estimate the tax on a jacket that costs $69.95.
If y^8= 4 and y^7=3/x, what is the value of y in terms of x?