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

Last week a painter painted 3 houses in 5 days. this week she painted 2 houses in 4 days. in which week was the painter more productive, and what was her produc
Which city below were the Jews exiled from? Sidon Babylon Jerusalem Palestine Cyprus
Two or more substances dispersed in one another but each retaining their own identity is a _____. compound mixture substance solute
In an experiment, a student mixed a substrate and an enzyme. What is the reaction?
all cells have similar functions.name at least three
A localized response to an injury or the destruction of tissues is known as
Cindy is using division to write a fraction equivalent to 30-100.She tried to divide the numerator and denominator by 3.She got stuck.What advice would you give
How can you use 10% of a number to find 20% of the number 30%?
Solve |2x + 1| = 10
John Peter Zenger was charged with the crime of _____________against a state official. a. Treson c. Libel b. Theft d. Bigamy