merge sorted array