Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work for Huffman trees #7

Open
deb17 opened this issue Aug 23, 2019 · 0 comments
Open

Does not work for Huffman trees #7

deb17 opened this issue Aug 23, 2019 · 0 comments

Comments

@deb17
Copy link

deb17 commented Aug 23, 2019

Hi,

drawtree works for integer nodes. I was trying to draw a huffman tree with it - it gave an error when trying to do an int conversion of a letter. The code is in deserialize function:

nodes = [None if val == '#' else TreeNode(int(val))
             for val in string.strip('[]{}').split(',')]

When I removed the int call, I got the tree. Is it not possible to support alphanumeric nodes by doing so?

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant