Additional c++ algorithms