made array type as generic in mergeSort