def merge_sort(arr):
if len(arr)>1:
mid=len(arr)//2
left_arr=arr[:mid]
right_arr=arr[mid:]
#Recursively sort the two halve
merge_sort(left_arr)
merge_sort(right_arr)
i=j=k=0
while i<len(left_arr) and j<len(right_arr):
if left_arr[i]<right_arr[j]:
arr[k]=left_arr[i]
i+=1
else:
arr[k]=right_arr[j]
j+=1
k+=1
# Copy the remaining elements of left_arr, if any
while i<len(left_arr):
arr[k]= left_arr[i]
i+=1
k+=1
while j < len(right_arr):
arr[k] = right_arr[j]
j += 1
k += 1
arr_test = [2, 3, 5, 1, 7, 4, 4, 4, 2, 6, 0]
merge_sort(arr_test)
print(arr_test)