Basic algorithms written in C language