Exemplo n.º 1
0
def test_pq(n):
    arr = lib.get_random_array(n)
    pq = PQ()
    for i in arr:
        pq.add(i)
    lib.print_array(pq.arr)
    while pq.length > 0:
        r = pq.pop()
        print(r)
Exemplo n.º 2
0
def test_sort_merge_array(n):
    arr = lib.get_random_array(n)
    sorted_arr = sort_merge_array(arr)
Exemplo n.º 3
0
def test_sort_quick_array(n):
	arr = lib.get_random_array(n)
	sort_quick_array(arr)
Exemplo n.º 4
0
def test_sort_heap(n):
    arr = lib.get_random_array(n)
    sort_heap(arr)
Exemplo n.º 5
0
def test_sort_selection(n):
    arr = lib.get_random_array(n)
    sort_selection_arr(arr)

    node_list = lib.get_random_node_list(n)
    sort_selection_list(node_list)
Exemplo n.º 6
0
def test_sort_insertion(n):
    node_list = lib.get_random_node_list(n)
    sort_insertion_list(node_list)

    arr = lib.get_random_array(n)
    sort_insertion_array(arr)