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

1. Which angle is complementary to angle BAC?
opción que contiene los elementos que favorecieron el asentamiento de las culturas mesoamericanas​
What is the ratio of the diffussion of Co2 and O2​
find a recurrence relation for the number of permutations of a set with n elements
You are the secretary of the ‘Eco Club’ in your school. Your club has organised a ‘Beach Clean Drive’ for students of Grade VII and VIII. Write a notice to be
what the different between geography and history ​
Molecules of CO2 that have a lot of energy can do two different things with this energy. What are these two things. Answer plzzz
I need help who wanna help me? what is 1000× 10000?​
Please comment if you have ever been tickled!!! I am very ticklish and I wanna know how to stop being ticklish!!! Pls, help!!!
Pipelining decreases the latency of each task. true false