some basic algorithms developed in c