sort algorithms implemented by c++