Return the number of leaf nodes
(self)
| 615 | """Testing only""" |
| 616 | |
| 617 | def leaf_count(self) -> int: |
| 618 | """Return the number of leaf nodes""" |
| 619 | count = 0 |
| 620 | node = self.leaves |
| 621 | while node is not None: |
| 622 | count += 1 |
| 623 | node = node.next |
| 624 | return count |
| 625 | |
| 626 | def _count_total_nodes(self) -> int: |
| 627 | """Count total nodes in the tree (for testing/debugging)""" |
no outgoing calls