return the left child index if the left child exists. if not, return None.
(self, parent_idx: int)
| 89 | return None |
| 90 | |
| 91 | def left_child_idx(self, parent_idx: int) -> int | None: |
| 92 | """ |
| 93 | return the left child index if the left child exists. |
| 94 | if not, return None. |
| 95 | """ |
| 96 | left_child_index = 2 * parent_idx + 1 |
| 97 | if left_child_index < self.heap_size: |
| 98 | return left_child_index |
| 99 | return None |
| 100 | |
| 101 | def right_child_idx(self, parent_idx: int) -> int | None: |
| 102 | """ |