programs and algotithms in C++