Return the number of nodes in this tree.
(self)
| 453 | return True |
| 454 | |
| 455 | def __len__(self) -> int: |
| 456 | """ |
| 457 | Return the number of nodes in this tree. |
| 458 | """ |
| 459 | ln = 1 |
| 460 | if self.left: |
| 461 | ln += len(self.left) |
| 462 | if self.right: |
| 463 | ln += len(self.right) |
| 464 | return ln |
| 465 | |
| 466 | def preorder_traverse(self) -> Iterator[int | None]: |
| 467 | yield self.label |
nothing calls this directly
no outgoing calls
no test coverage detected