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

Describe the octet rule and the part it plays in bonding.
Medicare is a welfare program, and eligibility is determined based on income level.a) Trueb) False
what is 1/10 of 0.002
Suppose x is an integer. If 5 | 2x, then:_______ a. None of the above b. 5|2c. 5|x d. 5| 2 and 5|x
How many years queen Elizabeth lived?
An angle measures  25° . What is the measure of its supplement? (b) An angle measures  30° . What is the measure of its complement?​
△ ABC and △ DEF are similar. The length of the smallest side of △ ABC is 2 units and the length of the smallest side of △ DEF is 5 units. The area of △ ABC is 4
A student is measuring the volumes of nectar produced by a flowering plant for an experiment. He measures nectar from 50 flowers using a graduated cylinder that
Ellie's boat trailer has a weight limit of 6 tons. Her boat weighs 5,000 pounds. A boat on a trailer is shown. How many more pounds can the trailer carry befor
A case of paper weighs 20 kilograms what is this weight in pounds?