def _cmp(self, i: int, j: int) -> bool:
        Returns index of valid parent as per desired ordering among given index and
        both it's children
        parent = self._parent(index)
        while parent is not None and not self._cmp(index, parent):
            self._swap(index, parent)
            index, parent = parent, self._parent(parent)