here is the python code for the merge sort algorithmdef mergesort( )#base case if the input array is one or zero just return if len( splitting input array print('splitting ' mid len( )// left [:midright [mid:#recursive calls to mergesort for left and right sub arrays mergesort(leftmergesort(right#initalizes pointers for left (iright (jand output array ( initalization operations #traverse and merges the sorted arrays while <len(leftand <len(right)if left right comparison operation if left[iright[ ]if left right assignment operation [ ]=left[ii= + else#if right <left assignment [ ]right[jj= + = + while <len(left)