We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Python coders beware: when node.data does not contain a character, it is not an empty string or None. It is '\0'.
This drove me nuts for 20 min until I read some discussions.
I feel like this was a poor choice of "empty" string. Why not just set it to None or ""? I guess I learned something new about Python today but it had nothing to do with trees. Anyone disagree?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Huffman Decoding
You are viewing a single comment's thread. Return to all comments →
Python coders beware: when node.data does not contain a character, it is not an empty string or None. It is '\0'.
This drove me nuts for 20 min until I read some discussions.
I feel like this was a poor choice of "empty" string. Why not just set it to None or ""? I guess I learned something new about Python today but it had nothing to do with trees. Anyone disagree?