Update algorithm.cpp

sample algorithm