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

number of outer rings in cesium and magnesium??
What type of crop plantations proved to provide slaves with the worst living conditions?
Ashamed of the cruelty of his military victories, this leader from northern India became a Buddhist and built hospitals, roads, and places of worship. Who does
A horizontal line passes through the point (5, –1). Which point is also on this line? (0, 0) (–1, 5) (5, –4) (–2, –1)
I need help on these questions PLEASE
the product of half my number times my number is 162.what is my twice my number
what is 0.04 is 1/10 of
According to Gibbon, in what ways has "primitive man progressed over time? what assures the author that this progress will continue?
how was life before the industrial revolution different from the life after it
What is 3.2 x 10^-4 m/h in centimeters per second? a) 8.889 × 10^−6 cm/s b) 8.889 × 10^−5 cm/s c) 1.152 × 10^−5 cm/s d) 1.152 × 10^−7 cm/s