Ejemplo n.º 1
0
    def test_right_two(self):
        max_heap = MaxHeap([1])

        right = max_heap.right(2)
        self.assertEquals(6,right)
Ejemplo n.º 2
0
    def test_right_zero(self):
        max_heap = MaxHeap([1])
        right = max_heap.right(0)

        self.assertEquals(2,right)
Ejemplo n.º 3
0
    def test_right_one(self):
        max_heap = MaxHeap([1])

        right = max_heap.right(1)
        self.assertEquals(4,right)
Ejemplo n.º 4
0
    def test_left_one(self):
        max_heap = MaxHeap([1])

        left = max_heap.left(1)
        self.assertEquals(3,left)
Ejemplo n.º 5
0
    def test_left_two(self):
        max_heap = MaxHeap([1])

        left = max_heap.left(2)
        self.assertEquals(5,left)
Ejemplo n.º 6
0
    def test_left_zero(self):
        max_heap = MaxHeap([1])
        left = max_heap.left(0)

        self.assertEquals(1,left)
Ejemplo n.º 7
0
    def test_parent_six(self):
        max_heap = MaxHeap([1])

        parent = max_heap.parent(6)
        self.assertEquals(2,parent)
Ejemplo n.º 8
0
    def test_parent_five(self):
        max_heap = MaxHeap([1])

        parent = max_heap.parent(5)
        self.assertEquals(2,parent)
Ejemplo n.º 9
0
    def test_parent_three(self):
        max_heap = MaxHeap([1])

        parent = max_heap.parent(3)
        self.assertEquals(1,parent) 
Ejemplo n.º 10
0
    def test_parent_two(self):
        max_heap = MaxHeap([1])

        parent = max_heap.parent(2)
        self.assertEquals(0,parent)