Suppose algorithm B takes five seconds to handle a data set of 1,000 records. If the algorithm B is an O(n2) algorithm, approximately how long (in seconds) will it take to handle a data set of 2,000 records

Respuesta :

Answer:

It will take 25 seconds.

Explanation:

O(n) notation implies the time complexity of an algorithm, time to take an algorithm to execute. n refers to the number of elements that will be executed.

In the question, the algorithm is O([tex]n^{2}\\[/tex]), meaning time to complete the execution will double if you double the data set.

Therefore, if it takes 5 seconds for 1000 elements, it will take 25 seconds for 2000 elements.

ACCESS MORE
EDU ACCESS