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 is the principal part of the underlined verb in the sentence? Mom and Dad have walked every night after dinner. A. past B. present C. present pa
why would the present shape of the continents not fit perfectly into the shape of a supercontinent
why did john cabot, amerigo vespucci, and vasco nunez de balboa set out on exploration across the atlantic oceab?
advantages of being an extremophile
What happens when water is added to a sand-salt mixture
what the unit rate in 14 hours in 2 weeks
If the radius of mars is about 13.7% of neptune's radius, what is the radius of neptune?
A singer performed 9 songs at a recital. She had 3weeks to practice. How many songs did she practice each week if she practiced an equal number of songs each we
Which two key principles of government are included in the Declaration of Independence?
Kate made 4 dresses with 7 yards of fabric. how many yards did she use on 1 dress