import time import sys def mergeSort(sh,ii,mid,ff): global no_swap global no_comp n=ii p=mid+1 while p <= ff and n<= mid : if(sh[n]>sh[p]): no_comp=no_comp+1 t=sh[p] k=p while k!=n: sh[k]=sh[k-1] k=k-1 sh[n]=t p=p+1 n=n+1 mid=mid+1 no_swap=no_swap+1 else: n=n+1 def mergesort(sh,i,f): global no_swap global no_comp x=f-i if(x <= 1): if(sh[f]