added mergeSort to DynamicArray