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

What is the sum of any number and its opposite?
Which of the following points are on the circle? Check all of the boxes that apply. –6 – 3i 4 + 13i 8 + 5i 10i
George Washington first gained weight in ministration by colonist for
What are all the real and complex solutions of the polynomial equation? x^3= 216​
Why does the author use the words "wet brown life" in this excerpt ?
Elsa has $48.65 in her savings account and $23.40 in her wallet. How much more money is in Elsa's savings account than in her wallet?
Please solve for y and show the steps in the situation.​
Channel proteins form pores through the membrane to carry particles like _______________. A. Water B. Sodium Ions C. Potassium Ions B + C
Can someone help me?
Need some help with this one please