MCPcopy Create free account
hub / github.com/ActiveState/code / link

Method link

recipes/Python/511508_Binomial_Queues/recipe-511508.py:19–29  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 +

Callers 4

gameFunction · 0.80
gameFunction · 0.80
do_pdf_pagesFunction · 0.80
__add_treeMethod · 0.80

Calls 2

LinkErrorClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected