Unoptimized mergesort in C++