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

The greatest common factor of 15u2v3, 20u5v2, and 45u3v5 is
There are 40 tables in a library, with 30% of them seating 4 people. The tables remaining only seat 2 people. How many seats are there in the library?
n act III of Hamlet, why did Hamlet choose not to kill Claudius while he was praying?
The Treaty of Brest Litovsk allowed the Russians to leave the war even with their huge gains of territory. True False
How do you write 19% as a fraction in simplest form?
a deer tick attaches to a deer and receives a blood meal.
A. how many fifths are there in a whole? b. how many thirds are there in 2 1/3? c. how many 2/5 are there in 4?
The iron curtain signified
What is the total surface area for #3
Measure the length of the day on the spring and fall equinoxes for latitudes 0, 15, 30, 45, 60, 75, and 90. With the exception of the North and South poles, (a