Bottom-up mergesort