0

I am trying to figure out the average-case time complexity of a program. I managed to find the completion times for certain input sizes like:

Size-Time

12 - 0.11552862

13 - 0.12365744

14 - 0.20763664

15 - 0.51893218

16 - 1.6423617

17 - 7.625521

And I created a graph. Graph

Is it possible to find the time complexity with only this information. I am kinda lost now.

  • Does this answer your question? [How to find time complexity of an algorithm](https://stackoverflow.com/questions/11032015/how-to-find-time-complexity-of-an-algorithm) – sahasrara62 Feb 08 '20 at 20:33

1 Answers1

0

No it is not possible to find the time complexity with just this information. Without looking at the code, determining the time complexity is not possible in this case.

One (of the many) simple examples where this time and input analysis would not hold good is if you have certain if statements in your code that cause something to execute that the inputs you have provided do not take into consideration.

You could refer to this answer:

How to find time complexity of an algorithm

Another answer that is helpful is:

Big O, how do you calculate/approximate it?

Rahul P
  • 2,493
  • 2
  • 17
  • 31