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

which of the following expressions does not equal: the sixth root of 81x^4y^8 a. (3xy^2)^2/3 b. (3x)^2/3y^4/3 c. (3x^2y^4)^1/3 d. cube root of 9x^2y^4
Tennis balls with a diameter of 2.5 in. are packaged 3 to a can. The can is a cylinder. Find the volume of the space in the can that is not occupied by tennis b
which foods earthworms can digest?
let g(x)=x-3 and h(x)=x^2+6 find (h o g) (1)
can u tell me how to solve this promblem 4/7 plus 3/7
The Habsburg Empire did all of the following EXCEPT A. take control of Hungary, Croatia, and Slovonia. B. lose their Holy Roman Empire in Germany. C. remain a c
which foods earthworms can digest?
which type of gas is filled in lays pack and why?
what is force ?is it desirable or undesirable?
List all integers between -0.6 and 4.17 THANK U