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

4|x+5|=20 Thanks for the help
What is the simplest form of 144:132
Please answer the following question in English. List at least two reasons why you think it is beneficial to learn Spanish. When entering your answers for fill
is this correct?: data can be arranged in visual displays called _graphs_ to make identifying trends easier. (or would it be bar graphs..?
How does the sun cause wind?
How does the number of zeros in the product of 8 and 5000 compare to the number of zeroes in the factor
what is 9 copies of 3.65
132,554 round to nearest tenth
what is 1/10 of 90000
Why do presenters use presentation aids? a. to make the presentation seem less credible b. to make the presentation more memorable c. to model the concepts o