Algorithms implemented in C