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 x intercept of 2x + 4y = 20
A large retail advertiser with more than 5,000 products wants to upsell to consumers who have purchased products on its website. The retailer needs to reach cus
URGENT!!! Find the scale factor of △ABC to △DEF. △ABC: BC = 18, AB = 15, AC = 12 △DEF: EF = 12, DE = 10, DF = 8
help! find the area of each figure
Question is in the image
andrew jackson was a western “favorite boy” and a war hero from which war?
why is alcoholism considered as a cultural problem prove it​
Which property was used to solve the equation? 5x=20 5x/5=20/5 x=4 Addition Property of Equality Subtraction Property of Equality Multiplication Property of Equ
Evaluate the expression, when p= 6 P^2 - 18?
e.gDearThursday3 Juneorary diaryToday latew days ago I tacedvery funny incidentmyliteot​