Exemple #1
0
def test__Heap_is_heap_satisified6():
    heap = Heap()
    heap.root = Node(0)
    heap.root.left = Node(2)
    heap.root.left.left = Node(3)
    heap.root.left.right = Node(5)
    heap.root.right = Node(1)
    heap.root.right.left = Node(4)
    heap.root.right.right = Node(-1)
    assert not heap.is_heap_satisfied()
Exemple #2
0
def test__Heap_is_heap_satisified1():
    heap = Heap()
    heap.root = Node(0)
    heap.root.left = Node(2)
    heap.root.left.left = Node(2)
    heap.root.left.right = Node(5)
    heap.root.right = Node(0)
    heap.root.right.left = Node(0)
    heap.root.right.right = Node(30)
    assert heap.is_heap_satisfied()
Exemple #3
0
def test__Heap_is_heap_satisified4():
    heap = Heap()
    heap.root = Node(0)
    heap.root.left = Node(-1)
    assert not heap.is_heap_satisfied()
Exemple #4
0
def test__Heap_is_heap_satisfied2():
    heap = Heap()
    heap.root = Node(-2)
    heap.root.left = Node(3)
    heap.root.right = Node(4)
    assert heap.is_heap_satisfied()