Returns the smallest element in this tree. This method is guaranteed to run in O(log(n)) time.
(self)
| 410 | return self.label |
| 411 | |
| 412 | def get_min(self) -> int | None: |
| 413 | """Returns the smallest element in this tree. |
| 414 | This method is guaranteed to run in O(log(n)) time. |
| 415 | """ |
| 416 | if self.left: |
| 417 | # Go as far left as possible |
| 418 | return self.left.get_min() |
| 419 | else: |
| 420 | return self.label |
| 421 | |
| 422 | @property |
| 423 | def grandparent(self) -> RedBlackTree | None: |