If you choose quadratic spline, and then let's suppose the first quadratic is linear, you can find that one and the next one, and the next one, etc. I think it would be most efficient. The first quadratic can be found as linear; its slope is then known at the 2nd point. Coupled with the slope at the 2nd point, we know values at the 2nd and 3rd points, which gives us all coefficients of the second quadratic. Continue to do this. If the last quadratic is chosen as linear, start backward. Or you can follow to set it up like nm.mathforcollege.com/mws/gen/05inp/mws_gen_inp_txt_spline.pdf, and solve by using the Gauss elimination method. You may want to rearrange how the equations are written to take advantage of the sparseness of a coefficient matrix. You may also want to choose quadratics of the form a0+a1*(x-xi)+a2*(x-xi)^2, to increase the sparseness of the coefficient matrix. How to solve banded matrix equations is out of the scope of the course but surely explorable. scicomp.stackexchange.com/questions/30072/ways-to-solve-ax-b-for-a-sparse-banded-a-with-updates