@@ -0,0 +1,1338 @@
+from __future__ import absolute_import%0Afrom __future__ import print_function%0Afrom __future__ import division%0A%0A%0Adef merge_sort(a_list):%0A    %22%22%22Merge sort.%22%22%22%0A    print('Binary split: %7B%7D'.format(a_list))%0A    %0A    if len(a_list) %3E 1:%0A        # Merge sort by recursion.%0A        mid = len(a_list) // 2%0A        left_list = a_list%5B:mid%5D%0A        right_list = a_list%5Bmid:%5D%0A        merge_sort(left_list)%0A        merge_sort(right_list)%0A%0A        # Merge two small sorted lists.%0A        i = 0%0A        j = 0%0A        k = 0%0A        while i %3C len(left_list) and j %3C len(right_list):%0A            if left_list%5Bi%5D %3C right_list%5Bj%5D:%0A                a_list%5Bk%5D = left_list%5Bi%5D%0A                i += 1%0A            else:%0A                a_list%5Bk%5D = right_list%5Bj%5D%0A                j += 1%0A            k += 1%0A%0A        while i %3C len(left_list):%0A            a_list%5Bk%5D = left_list%5Bi%5D%0A            i += 1%0A            k += 1%0A%0A        while j %3C len(right_list):%0A            a_list%5Bk%5D = right_list%5Bj%5D%0A            j += 1%0A            k += 1%0A%0A    print('Merge %7B%7D'.format(a_list))%0A%0A%0Adef main():%0A    import time%0A%0A    start_time = time.time()%0A    a_list = %5B54, 26, 93, 17, 77, 31, 44, 55, 20%5D%0A    print('a_list: %5Cn%7B%7D'.format(a_list))%0A    print('By merge sort:')%0A    merge_sort(a_list)%0A    print('Run time: %7B%7D'.format(time.time() - start_time))%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add alg_merge_sort_bak.py