117k views
2 votes
I have an algorithm that runs in O(N ), where N is the size of the problem. For N = 100, the time for the algorithm to run is 1 minute. How long does the algorithm take for N=1000? A) Same time B) 10 minutes C) 100 minutes D) 1000 minutes

User Foxes
by
7.4k points

1 Answer

2 votes

Answer:

B) 10 minutes

Step-by-step explanation:

When the size of the problem is 100 then it takes 1 minute to solve


100\ s=1\ min

So, when the size of the problem is 1 then it takes the following minutes


1\ s=(1)/(100)\ min

For when the size of the problem is 1000 we have


1000\ s=(1000)/(100)\ min=10\ min

So, it will take 10 minutes to solve the algorithm of size 1000

User Whittle
by
7.8k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.