def merge(li, low, mid, high):
i = low
j = mid + 1
tmp = []
while i <= mid and j <= high:
if li[i] < li[j]
tmp.append(li[i])
i += 1
else:
tmp.append(li[j])
j += 1
while i <= mid:
tmp.append(li[i])
i += 1
while j <= high:
tmp.append(li[j])
j += 1
li[low:high+1] = tmp
def merge_sort(li, low, high):
if low < high:
mid = (low + high) // 2
merge_sort(li, low, mid)
merge_sort(li, mid+1, high)
merge(li, low, mid, high)