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

Class node

Python/HuffmanCodingAlgo.py:3–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import heapq
2
3class node:
4 def __init__(self, freq, symbol, left=None, right=None):
5
6 self.freq = freq
7
8 self.symbol = symbol
9
10 self.left = left
11
12 self.right = right
13
14 self.huff = ''
15
16 def __lt__(self, nxt):
17 return self.freq < nxt.freq
18
19def printNodes(node, val=''):
20

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected