Skip to content

Commit d537622

Browse files
committedMay 3, 2017
deleted unused method
1 parent 6547c06 commit d537622

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed
 

‎huffman.py

-7
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,18 @@ def __init__(self, arr):
5959

6060
# dictionaries to store huffman table
6161
self.__value_to_bitstring = dict()
62-
self.__bitstring_to_value = dict()
6362

6463
def value_to_bitstring_table(self):
6564
if len(self.__value_to_bitstring.keys()) == 0:
6665
self.__create_huffman_table()
6766
return self.__value_to_bitstring
6867

69-
def bitstring_to_value_table(self):
70-
if len(self.__bitstring_to_value.keys()) == 0:
71-
self.__create_huffman_table()
72-
return self.__bitstring_to_value
73-
7468
def __create_huffman_table(self):
7569
def tree_traverse(current_node, bitstring=''):
7670
if current_node is None:
7771
return
7872
if current_node.is_leaf():
7973
self.__value_to_bitstring[current_node.value] = bitstring
80-
self.__bitstring_to_value[bitstring] = current_node.value
8174
return
8275
tree_traverse(current_node.left_child, bitstring + '0')
8376
tree_traverse(current_node.right_child, bitstring + '1')

0 commit comments

Comments
 (0)