MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / _cmp

Method _cmp

data_structures/heap/heap_generic.py:45–47  ·  view source on GitHub ↗

Compares the two items using default comparison

(self, i: int, j: int)

Source from the content-addressed store, hash-verified

43 self.arr[i], self.arr[j] = self.arr[j], self.arr[i]
44
45 def _cmp(self, i: int, j: int) -> bool:
46 """Compares the two items using default comparison"""
47 return self.arr[i][1] < self.arr[j][1]
48
49 def _get_valid_parent(self, i: int) -> int:
50 """

Callers 2

_get_valid_parentMethod · 0.95
_heapify_upMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected