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

Write a polynomial function with zeros at x = -2, 1, and 4.
3. Alice writes a stery Change into Past Perfect tense
Change the recurring decimal into fraction, 3.256
Which lines tell you that the woods are full of life?Chapter: The way through the woodsGrade: 8Please help....
Is 4x + 7x a polynomials. Why​
1. Point of view: How does Russell help you get into wolf mode?
which characteristic of life best describes the process of photosynthesis?
need a quick answer! WILL MARK BRAINIEST! w - x - y 2 - z
what is the algebraic expression for the sum of the square of a number and nine times the number?
If g=4 and h = -3 Evaluate:5g-7h