Calculate the complexity of an algorithm

1 view (last 30 days)
Max
Max on 5 Dec 2012
Hi at all, excuse me if something is not clear, I try to write in English as clear (and correct) as possible;)
I wrote an algorithm and now I want to calculate its complexity; in the evaluation of the complexity I think to exclude assignments that have constant complexity O (1) as irrelevant. I also do not calculate the "if" in which is printed only a message if a condition is satisfied or not.
The remaining important instructions are "for-cycle" and the construction of a cubic spline (understood as interpolation of n points);
As for loops ranging from the first to n-th, the complexity is O (n), correct?
Then, on the construction of the spline, how can I evaluate the computational cost knowing that I have to interpolate two vectors of n elements?
Thanks a lot
Max

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!