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

How many feet are there in 24 yards? A. 72 B. 8 C. 2 D. 288
I need a disorder for my class and I don't know any so I was wondering if any body knew some cool disorders that I could use for class
What does unique mean
Fish lay a large number of eggs, few of which are fertilized and very few of which hatch into young ones. Still fewer live to maturity and very few of these are
Help please I have a test tomorrow!!!!
Draw quick pictures and write to tell how you would add 342 and 416
In logic, arguments are never described as true. valid. inductive. sound.
A high percentage of student population in the College of 6 and Behavioral Sciences _____ planning to obtain an internship in the hospital while completing thei
The connotations of a word have little effect on its literal meaning. a. true b. false
If an oak tree is 5 feet and grows 6 every year write the equation