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

Read this paragraph from an informational text about earthquakes and tsunamis. Earthquakes can cause another type of natural disaster known as a tsunami. A tsun
Help me with this question please
First Brainliest answer​
What are the steps of middle distance running?
I'LL MARK BRAINLIEST!!If it became possible to live to be 150, would you want to?please write it in 3 or 4 lines♡♡​
if a=17 and b=12 what is the valueof a-b​
What is theatre making
how do you find the height of a cylinder? ​
in an election, candidate a got 75% of the total valid votes. if 15% of the total votes were declared invalid and the total numbers of votes is 560 000, find th
The graph of y = f ′(x), the derivative of f(x), is shown below. List the intervals where the graph of f is concave down. (–4, –2) U (2, 4) (–2, 2) (–4, 0)