Example #1
0
def full_min_heap():
    test_heap = MinHeap()
    test_heap.add(4)
    test_heap.add(6)
    test_heap.add(3)
    test_heap.add(7)
    test_heap.add(5)
    return test_heap
Example #2
0
from heaps import MinHeap
from heaps import random

lst = []

heap = MinHeap()
for i in range(10):
    random_number = random.randint(1, 10)
    lst.append(random_number)

for i in lst:
    heap.add(i)

print(heap.heap_list)

print(heap.traverse(5))