aboutsummaryrefslogtreecommitdiff
path: root/ass3/q2
diff options
context:
space:
mode:
authorakiyamn2021-05-16 16:41:41 +1000
committerakiyamn2021-05-16 16:41:41 +1000
commit3501b45c59c14efd2d953d864a7afc8bb5cf4d14 (patch)
tree6dd87b62ed1eea5281fd287de6cf982c69229f39 /ass3/q2
parent7202c67e2d464dc31e5124082e06586462774144 (diff)
downloadfit3155-3501b45c59c14efd2d953d864a7afc8bb5cf4d14.tar.gz
fit3155-3501b45c59c14efd2d953d864a7afc8bb5cf4d14.zip
Ass 3: Q3 it actually works
Diffstat (limited to 'ass3/q2')
-rw-r--r--ass3/q2/header.py3
1 files changed, 1 insertions, 2 deletions
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()