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 is using brevity important in the healthcare system
how does the division look for 8.43206 ÷ 26
What does jupiter have in common with the sun that the terrestrial planets don't? what differentiates jupiter from a star?
Which kind of adjectives is used most frequently in ordinary speech or writing
Discuss the ethical issues of social networks and anytime, anywhere accessibility.
What is the probability that a randomly thrown dart that lands within the rectangle lands within a shaded region? All of the circles are congruent, and the diam
hey can you please help me posted picture of question
please help! thank you
How does the personification in the lines “Time lifts the curtain unawares, / And Sorrow looks into her face…” affect meaning? A.When time lifts the curtain,
anyone that has diabetes please answer these questions please help urgent 1.When did you find out that you have diabetes? 2.How often do you have to test your g