(root: MyNode)
| 178 | |
| 179 | |
| 180 | def get_right_most(root: MyNode) -> Any: |
| 181 | while True: |
| 182 | right_child = root.get_right() |
| 183 | if right_child is None: |
| 184 | break |
| 185 | root = right_child |
| 186 | return root.get_data() |
| 187 | |
| 188 | |
| 189 | def get_left_most(root: MyNode) -> Any: |