Fundamental algorithms in C