Note that I don’t have a “problem” and I’m not looking for “another way to find the big O of my algorithm”.
What I’d like to know is if it would be possible write a program to which you’d pass data points that would all be perfs measurements of an algorithm for various input size: (n,time taken to solve problem for n) and that would then determine the complexity of your algorithm.
For example here’s what the input could be (it could be much larger, it’s really just an example, that’s not the point of the question):
36 000 took 16 ms
109 000 took 21 ms
327 000 took 68 ms
984 000 took 224 ms
2 952 000 took 760 ms
8 857 000 took 2305 ms
26 571 000 took 7379 ms
79 716 000 took 23336 ms
Using such kind of data, is it possible to write a program that would tell if we have, say, an O(n), log(n), n log(n) or n! algo?
What you are looking for is Curve fitting. All the simple algorithms for this problem that I know of will try to fit the data points into some sort of polynomial, but I suspect there’re those that will be able to differentiate between polynomials and non-polynomials too.