Calculate execution time using samples
Suppose you run your program as function N and create the following table:
N seconds
-------------------
4096 0.00
16384 0.01
65536 0.06
262144 0.51
1048576 4.41
4194304 38.10
16777216 329.13
67108864 2842.87
Estimate the order of growth of the running time as a function of N. Suppose that the running time obeys the power law T (N) ~ a N ^ b.
source to share
Your N are all sequential powers 4. Taking the logarithm of the four bases of sequential time relationships, you will see that they converge to some constant known as "b". When you plug the N, T (N), and b from the last entry in your spreadsheet into the power law (T (N) = a * N ^ b), you get "a". In your case, the log4 of the temporal ratio converges to 1.555, so "b".
I am assuming you are adopting Coursera "Algorithms Part I" (as I am). Then this stream should be available to you:
https://class.coursera.org/algs4partI-002/forum/thread?thread_id=149
Or you can refer to the Algorithm Analysis slides starting on page 16.
source to share
Use Least Squares Retention Law:
http://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html
This will give you the closest match for a and b, which you can use to extrapolate the execution time of new points.
source to share
This is more clear to me:
N seconds log(N, 2) log(seconds, 2) Y(n)-Y(n+1)/
or X or Y X(n)-X(n+1)
----------------------------------------------------------------------------
4096 0 12 #NUM!
16384 0.01 14 -6.64385619 1.29248125
65536 0.06 16 -4.058893689 1.543731421
262144 0.51 18 -0.9714308478 1.556104752
1048576 4.41 20 2.140778656 1.555470218
4194304 38.1 22 5.251719093 1.555397315
16777216 329.13 24 8.362513723 1.555309345
67108864 2842.87 26 11.47313241
Answer: b approximately 1.55
Estimate the order in which the execution time increases depending on N. This is the google drive version ...
source to share