I know the mergeSort function takes O(logn) and merge function takes O(n) and therefore total complexity is O(nlogn).
void mergeSort(int arr[], int l, int r){