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.
in a huffman tree, a parent node will always have 2 child as we begin by combining 2 nodes and repeat it untill we are done. due to this property, we can safely say that if either of the left or right pointer is null, the other one is also null, and hence it is a leaf node.
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 →
in a huffman tree, a parent node will always have 2 child as we begin by combining 2 nodes and repeat it untill we are done. due to this property, we can safely say that if either of the left or right pointer is null, the other one is also null, and hence it is a leaf node.