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

During the Vietnam war, more than 2 million Americans served. a. True b. False
A test question about a specific fact, like Who was president of the United States when the Great Depression began, is a(n) ________________ question. right th
How many symphonies did Brahms write? A. Four B. Nine C. Seven D. Six
What is the value of 7/8 +3/4
where is the bathroom in French?
The actual cells that the muscles are made of are called _____.
Who was head of the Final Solution? a. Himmler c. Roosevelt b. Hitler d. Churchil
factor completely 10x^3+16x^2-8x
Goods that are created and used domestically are __________. a. exported to another country b. imported from another country c. produced and consumed in one cou
a key principle of the economic theory of communism is