Implementation of the mergesort algorithm with deque(s)