return the right child index if the right child exists. if not, return None.
(self, parent_idx: int)
| 99 | return None |
| 100 | |
| 101 | def right_child_idx(self, parent_idx: int) -> int | None: |
| 102 | """ |
| 103 | return the right child index if the right child exists. |
| 104 | if not, return None. |
| 105 | """ |
| 106 | right_child_index = 2 * parent_idx + 2 |
| 107 | if right_child_index < self.heap_size: |
| 108 | return right_child_index |
| 109 | return None |
| 110 | |
| 111 | def max_heapify(self, index: int) -> None: |
| 112 | """ |