def sift_up_test_3(): heap = MinHeap([10, 20, 25, 22, 30, 25, 9], already_heap=True) print(f"Original: {heap}") heap.sift_up(6) print(heap)
def sift_up_test_4(): heap = MinHeap([10, 20, 25, 18, 19, 25, 28], already_heap=True) print(f"Original: {heap}") heap.sift_up(4) heap.sift_up(3) print(heap)
def sift_up_test_1(): heap = MinHeap([10, 20, 25, 22, 30, 25, 28], already_heap=True) print(f"Original: {heap}") for i in range(7): heap.sift_up(i) print(heap) # No change expected