MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / printNodes

Function printNodes

Python/HuffmanCodingAlgo.py:19–29  ·  view source on GitHub ↗
(node, val='')

Source from the content-addressed store, hash-verified

17 return self.freq < nxt.freq
18
19def printNodes(node, val=''):
20
21 newVal = val + str(node.huff)
22
23 if(node.left):
24 printNodes(node.left, newVal)
25 if(node.right):
26 printNodes(node.right, newVal)
27
28 if(not node.left and not node.right):
29 print(f"{node.symbol} -> {newVal}")
30
31
32chars = ['a', 'b', 'c', 'd', 'e', 'f']

Callers 1

Calls 1

printFunction · 0.50

Tested by

no test coverage detected