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

Which numbers are a distance of 3 units from −1 on a number line? Select the location on the number line to plot each point. -1010-1-9-8-7-6-5-4-3-2012345678
Where do electromagnetic waves move most quickly HELP ANSWER QUICKLY 80POINTS
3x - y = 12 4x - 5y = 16
Which factor slowed the progress of the abolition movement in the United States?
how much of a cell in the human body in composed of water
Find the volume of cylinder with radius of 5.5 feet and a height of 11.4 feet
What is a circumpolar star? A)a star that is close to the north celestial pole a star that is close to the south celestial pole C) a star that always remains ab
help plz :)) <3 i’m confused
How far does a car move when it travels 50 miles an hour for 4 hours?
What is the density of a substance that has a mass of 55.4 g and a volume of 10 cm3?