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 did Alexander the Great rise to power and how did he spread Greek culture to other lands?
There is an inverse relationship between x and y. If y is when x is 3, what is x when y is 9? 3 5
What sorts of signals does the brain use to communicate sensations, thoughts and actions?
how might a scientist a determine  whether trait sex-linked by observing the offspring of several genetic crosses
What culture believes health is harmony between man and nature?
What is a group of organisms that look alike and can reproduce among their selfs ?
What is a series of events that cells go through as they grow and divide
What is a series of events that cells go through as they grow and divide
How did the Declaration of Independence change the nature of the American Revolution?
why can parents who are heterozygous for type a and type b blood have children with any of the four human blood types?