Add helper functions for top-down mergesort test