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

Why were people from Africa brought to Georgia?
If ab = 10 and a2 + b2 = 30, what is the value of (a + b)^2?
The unstated purpose of the Alien and Sedition Acts was to (A) unite the nation in time of danger (B) deport immigrants who were becoming too numerous (C) prote
what is the kingdom and phylum of a euglena protest?
Why were people from Africa brought to Georgia?
If it takes Mark twice as long to earn $6.00 as it takes Carl to earn $4.00, what is the ratio of Mark’s pay per hour to Carl’s pay per hour?
What is 0.05 percent of 6.5?
What is 0.05 percent of 6.5?
how do day and nightat uranus's equator change asthe uranus revolves around the sun?
What is the slope of any line parallel to the line 8x + 9y = 3 in the standard (x,y) coordinate plane?