Consider the following algorithms. Each algorithm operates on a list containing n elements, where n is a very large integer.
I. An algorithm that accesses each element in the list twice.
II. An algorithm that accesses each element in the list n times.
III. An algorithm that accesses only the first 10 elements in the list, regardless of the size of the list. Which of the algorithms run in reasonable time?
a. I only.
b. III only.
c. I and II only.
d. I, II, and III.

Respuesta :

We have that the appropriate statement will be

  • An algorithm that accesses only the first 10 elements in the list, regardless of the size of the list. Which of the algorithms run in reasonable time

III only.

Option B

From the question we are told

Consider the following algorithms. Each algorithm operates on a list containing n elements, where n is a very large integer.

I. An algorithm that accesses each element in the list twice.

II. An algorithm that accesses each element in the list n times.

III. An algorithm that accesses only the first 10 elements in the list, regardless of the size of the list. Which of the algorithms run in reasonable time?

Algorithm  

Generally In order to get admission to every thing in the list twice, the algorithm has to traverse the listing twice,

which leads to 2*n entry to operations.

And if the every factor is accessed n times, the listing will be traversed n time, which leads to n^2 get right of entry to operations.

If n is a very giant integer, each 2*n and n^2 are plenty larger.

So, there will be solely ten entry to operations and this algorithm will have a sensible jogging time.

Therefore

An algorithm that accesses only the first 10 elements in the list, regardless of the size of the list. Which of the algorithms run in reasonable time

III only.

Option B

For more information on  algorithm  visit

https://brainly.com/question/950632