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 second stage of the writing process includes?
A water bill has increased by 25% to £52.50 work out the original cost?????
Solve the given differential equation. all solutions should be found. dy/dx=x^8-8y/x
A __________ is a behavior that violates criminal law and is punishable with fines, jail terms, and/or other negative sanctions.​
Uric acid results from the metabolism of _____ _____.
What is the weight of the 2 liter jug?
what political significance did The Pact of Paris have
The value of photosynthetically active radiation above which no further increase in photosynthesis occurs is referred to as:
At your local family fun center, miniature golf is $12 per person for unlimited rounds in a day, while each go-kart session is $8. If you played 3 rounds of mi
What factors allowed america to win the war for independence?