drawing cubic and quadratic splines

Hi, I’m working on an assignment where I need to evaluate curves using cubic and quadratic b-splines. I’m still doing some reading but i haven’t figured it out yet. Can anyone show me a good algorithm/code for either method?

thanks,

Will