External sorting implemented using C++