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

solve systems of equations by graphing
Which two actions were causes of the War of 1812? 1.The British stopped US merchant ships from sailing to France. 2.President Thomas Jefferson introduced the Em
Which of the following is not true about the Roman Republic? Citizens elected representatives to rule in their name. It was the first state to develop democracy
ead the excerpt from The Dark Game: True Spy Stories from Invisible Ink to CIA Moles. Wyke's work was always delicate and demanding, more so in the damp and con
What is it I do not know what it is
What does X equal how do I get it?
• Increase international security • Promote economic growth • Support human rights • Achieve world peace What organization works towards the goals listed above?
Why has poland been vulnerable to invasion?
The year 146 BCE was a watershed in the transition of Rome from
-7< -15 + x solve inequality