From 3501b45c59c14efd2d953d864a7afc8bb5cf4d14 Mon Sep 17 00:00:00 2001 From: akiyamn Date: Sun, 16 May 2021 16:41:41 +1000 Subject: Ass 3: Q3 it actually works --- ass3/q2/header.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ass3/q2') diff --git a/ass3/q2/header.py b/ass3/q2/header.py index 0db542f..a10b9a9 100644 --- a/ass3/q2/header.py +++ b/ass3/q2/header.py @@ -59,7 +59,6 @@ def huffman(string): new_node = first + second heapq.heappush(nodes, new_node) root = nodes[0] - root.dfs_apply(print) huffman_calculate(root) result = {} for leaf in leaves: @@ -110,7 +109,7 @@ def write_file(filename, contents): def main(): assert len(sys.argv) >= 2 string = read_file(sys.argv[1]) - write_file("output_header.txt", header(string)[0]) + write_file("output_header.txt", header(string)) if __name__ == "__main__": main() -- cgit v1.2.3