use pass by const ref instead of pass by value in external_sort