U9fix13
This commit is contained in:
parent
9915b2ebc5
commit
dd7dcb379f
@ -74,6 +74,8 @@ class HuffmanTree:
|
|||||||
def decode(self, bits):
|
def decode(self, bits):
|
||||||
if self.root is None:
|
if self.root is None:
|
||||||
return ""
|
return ""
|
||||||
|
if self.root.left is None and self.root.right is None:
|
||||||
|
return self.root.data * len(bits)
|
||||||
decodtext = ""
|
decodtext = ""
|
||||||
node = self.root
|
node = self.root
|
||||||
for i in bits:
|
for i in bits:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user