Returns right-child-index of given index if exists else None
(self, i: int)
| 28 | return left if 0 < left < self.size else None |
| 29 | |
| 30 | def _right(self, i: int) -> int | None: |
| 31 | """Returns right-child-index of given index if exists else None""" |
| 32 | right = int(2 * i + 2) |
| 33 | return right if 0 < right < self.size else None |
| 34 | |
| 35 | def _swap(self, i: int, j: int) -> None: |
| 36 | """Performs changes required for swapping two elements in the heap""" |