Example #1
0
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')
Example #2
0
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')
Example #3
0
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')
Example #4
0
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')
Example #5
0
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')
Example #6
0
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')