コード例 #1
0
def test_push_pop():
    heap = Heap(num_list)
    assert (heap.pushpop(0) == -2)
    assert (heap.pushpop(-1) == -1)
    assert (heap.poppush(99) == 0)
    assert (heap.poppush(-10) == 3)
コード例 #2
0
def test_push_pop():
    heap = Heap(num_list)
    assert(heap.pushpop(0) == -2)
    assert(heap.pushpop(-1) == -1)
    assert(heap.poppush(99) == 0)
    assert(heap.poppush(-10) == 3)