I'm finding a quick selection algorithm faster than the linear selection algorithm. To run some experiments I created two 3D plots which show the algorithm run time as the input array size and the function of the desired order figure. To use Gnuplot, I confirmed that in cases when the quadratic algorithm is fast, I used the Gnuplot's rotating algorithm, which used to function in my works (A, B, C, D, E, F Two functions are found, except for the ones that are stable but I am left):
lin_alg_runtime (x, y) = a x + b y + c
< P> quad_alg_runtime (x, y) = (d * x * e * y) + fwhere X is the input array size and y order number The Ha.
Now how do I use these models, to know how Quadratic implementation and Linear implementation I suspect that I have to find out what these two functions are but I Not sure how to do this, how does it show that these two functions are from?
Actually you want to use the algorithm which has the lowest runtime estimation.
You can only calculate each value of the estimated runtime, and use the lowest value algorithm. You can make it very easy.
You want to use quad algorithms when:
qual_alg_runtime (x, y) & lt; Lin_alg_runtime (x, y) ax + by + c & lt; Dxey + f axle by -dexy + c-f & lt; 0
So you can calculate ax + by -dexy + cf
and if it is less than zero, then use quadratic algorithm.
No comments:
Post a Comment