def run_insertion_sort(): rand_arr = utils.generate_random_array(101) rand_copy = list(rand_arr) rand_arr.sort() insertion_sort(rand_copy) assert_true(utils.compare_arrays(rand_arr, rand_copy), True, 'Insertion Sort')
def run_selection_sort(): rand_arr = utils.generate_random_array(100) copy = list(rand_arr) rand_arr.sort() approx_iterations = selection_sort(copy) assert_true(utils.compare_arrays(rand_arr, copy), True, 'Selection Sort')
def run_merge_sort(): rand_arr = utils.generate_random_array(100) rand_copy = list(rand_arr) rand_arr.sort() merge_sort(rand_copy) assert_true(utils.compare_arrays(rand_arr, rand_copy), True, 'Merge Sort')