Create Algorithm.cpp

the implementation of the algorithms