Algorithm Problems solved in C/C++