Ejemplo n.º 1
0
 def test_minheapify_OnRootExchanges(self):
     arr = [0, 2, 4, 1]
     dac.min_heapify(arr, 1)
     expected = [0, 1, 4, 2]
     self.assertEqual(expected, arr)
Ejemplo n.º 2
0
 def test_minheapify_OnLeafDoesntExchange(self):
     arr = [0, 1, 2, 3, 4, 5, 6]
     dac.min_heapify(arr, 6)
     expected = [0, 1, 2, 3, 4, 5, 6]
     self.assertEqual(expected, arr)