Make other_tree the son of self. Both trees must have the same rank, and other_tree must have a larger minimum priority
(self, other_tree)
| 17 | self.children = [] |
| 18 | |
| 19 | def link(self, other_tree): |
| 20 | """Make other_tree the son of self. Both trees must have the |
| 21 | same rank, and other_tree must have a larger minimum priority |
| 22 | """ |
| 23 | if self.rank != other_tree.rank: |
| 24 | raise LinkError() |
| 25 | if self.value > other_tree.value: |
| 26 | raise LinkError() |
| 27 | self.children.append(other_tree) |
| 28 | self.rank += 1 |
| 29 | return True |
| 30 | |
| 31 | def str(self, indent = 0): |
| 32 | return (" "*indent + |
no test coverage detected