Implementing some basic algorithms in C for CS350