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 are all the articles?
What is characteristic of a mineral
An amusement park has two types of season passes. Plan 1 costs a one-time fee of $129.00 for admission plus $7.00 every trip for parking. Plan 2 costs a one-tim
monique needs 2.75 cups of sugar for a pie recipe.she wants to make 5 pies. how many cups of sugar will she need?
Convert 3 18/25 to a decimal using long division.
? Which statement is true of an object in equilibrium?
divide the product of 4 and 5 by the sum of 2 and 8
what is the mandate of heaven?
Read the sentence below and complete the instruction that follows. Constellations, groups of stars, provide astronomers with a roadmap of the galaxy. Identify t
What is the percent error