A simple O(nlogn) (actually, depends on which sorting algorithm you use, but this is using quicksort) method is to put everything you have there into one sorted array. Then work your way through the...