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

Why is our year approximately 365 days long? Choose 1 answer: This is how long it takes Earth to travel once around the sun. This is how long it takes the sun t
Does anyone know the history of The Opium War?
Activity 1.2.2: Completing short dialogues In pairs, take turns and give advice to each other using the cues given below. Use the three ways of giving advice yo
Which symptom is characteristic of someone on a hallucinogenic drug?.
Determine the empirical formula. a 3.880g sample contains 0.691g of magnesium , 1.84 g of sulfur , and 1.365 g of oxygen .
45° x 100° y = [? ]º
let a={1,2,3,4,5} number of functions f from A to A such that f(m) +f(n)=7 whenever m+n = 7
Why is the alkyl bromide substrate below not capable of undergoing an E2 elimination reaction upon treatment with potassium hydroxide (KOH) in ethanol (EtOH)
f(x) = x². What is g(x)?
Coach palmer makes 9 quarts of iced tea. she fills 12 bottles with 2 cups of iced tea each to share with her team. how many quarts of iced tea are left?