invariants for iterativemergesort